auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<SelectItem> populateDocumentTypes() { List<SelectItem> localDocumentTypeList = new ArrayList<SelectItem>(); try { Properties localDocumentTypeProperties = PropertyAccessor.getInstance().getProperties(NhincConstants.DOCUMET_TYPE_PROPERTY_FILE); <START> for (Iterator<Entry<Object, Object>> it = localDocumentTypeProperties.entrySet().iterator(); it.hasNext();) { <END> Entry<Object, Object> property = it.next(); localDocumentTypeList.add(new SelectItem((String) property.getKey(), (String) property.getValue())); } } catch (PropertyAccessException ex) { LOG.error("Not able to load the document types from the property file:" + ex.getMessage()); } return localDocumentTypeList; }</code><technical_language>this a while loop. while(it.hasNext()). Common variable name for iterator is iter itr</technical_language>

Target:
private List<SelectItem> populateDocumentTypes() { List<SelectItem> localDocumentTypeList = new ArrayList<SelectItem>(); try { Properties localDocumentTypeProperties = PropertyAccessor.getInstance().getProperties(NhincConstants.DOCUMENT_TYPE_PROPERTY_FILE); Iterator<Entry<Object, Object>> it = localDocumentTypeProperties.entrySet().iterator(); while (it.hasNext()) { Entry<Object, Object> property = it.next(); localDocumentTypeList.add(new SelectItem((String) property.getKey(), (String) property.getValue())); } } catch (PropertyAccessException ex) { LOG.error("Not able to load the document types from the property file:" + ex.getMessage()); } return localDocumentTypeList; }
Source:
<code>public void execute(final OperationParams params) throws Exception { if (downloadDirectory == null) { final String homeDirectory = System.getProperty("geowave.home", "."); final Path path = Paths.get(homeDirectory, DEFAULT_DOWNLOAD_DIR); <START> InstallGdal.main(new String[] {path.toString()}); <END> } else { InstallGdal.main(new String[] {downloadDirectory}); } }</code><technical_language>Move InstallGdal.main function invocation out of conditional avoid code duplication. else removed if if statement updates downloadDirectory variable</technical_language>

Target:
public void execute(final OperationParams params) throws Exception { if (downloadDirectory == null) { final String homeDirectory = System.getProperty("geowave.home", "."); final Path path = Paths.get(homeDirectory, DEFAULT_DOWNLOAD_DIR); downloadDirectory = path.toString(); } InstallGdal.main(new String[] {downloadDirectory}); }
Source:
<code>void handleNoFollowsFlag(ByteBuf frame, SynchronousSink<ByteBuf> sink, int streamId) { ByteBuf header = removeHeader(streamId); if (header != null) { int maxReassemblySize = this.maxReassemblySize; if (maxReassemblySize != Integer.MAX_VALUE) { int currentPayloadSize = getMetadataSize(streamId) + getDataSize(streamId); if (currentPayloadSize + frame.readableBytes() - FrameHeaderCodec.size() > maxReassemblySize) { header.release(); frame.release(); cancelAssemble(streamId); throw new IllegalStateException("Reassembled payload went out of allowed size"); <START> } <END> } if (FrameHeaderCodec.hasMetadata(header)) { ByteBuf assembledFrame = assembleFrameWithMetadata(frame, streamId, header); sink.next(assembledFrame); } else { ByteBuf data = assembleData(frame, streamId); ByteBuf assembledFrame = FragmentationCodec.encode(allocator, header, data); sink.next(assembledFrame); } frame.release(); } else { sink.next(frame); } }</code><technical_language>If limit is reached fragment I allowed through. is in memory this point purpose of limit more prevent growth limit is exceeded cases fail for 1 byte over. lenient that</technical_language>

Target:
void handleNoFollowsFlag(ByteBuf frame, SynchronousSink<ByteBuf> sink, int streamId) { ByteBuf header = removeHeader(streamId); if (header != null) { int maxReassemblySize = this.maxInboundPayloadSize; if (maxReassemblySize != Integer.MAX_VALUE) { int currentPayloadSize = getMetadataSize(streamId) + getDataSize(streamId); if (currentPayloadSize + frame.readableBytes() - FrameHeaderCodec.size() > maxReassemblySize) { frame.release(); throw new IllegalStateException("Reassembled payload went out of allowed size"); } } if (FrameHeaderCodec.hasMetadata(header)) { ByteBuf assembledFrame = assembleFrameWithMetadata(frame, streamId, header); sink.next(assembledFrame); } else { ByteBuf data = assembleData(frame, streamId); ByteBuf assembledFrame = FragmentationCodec.encode(allocator, header, data); sink.next(assembledFrame); } frame.release(); } else { sink.next(frame); } }
Source:
<code>public MockBoundedByteBufferReceive send(Send send) throws IOException { if (!shouldRespond) { return null; } ServerErrorCode serverError = <START> hardError != null ? hardError : serverErrors.size() > 0 ? serverErrors.poll() : ServerErrorCode.No_Error; <END> RequestOrResponseType type = ((RequestOrResponse) send).getRequestType(); RequestOrResponse response; switch (type) { case PutRequest: response = makePutResponse((PutRequest) send, serverError); break; case GetRequest: response = makeGetResponse((GetRequest) send, serverError); break; case DeleteRequest: response = makeDeleteResponse((DeleteRequest) send, serverError); break; default: throw new IOException("Unknown request type received"); } ByteBufferChannel channel = new ByteBufferChannel(ByteBuffer.allocate((int) response.sizeInBytes())); response.writeTo(channel); ByteBuffer payload = channel.getBuffer(); payload.flip(); payload.getLong(); return new MockBoundedByteBufferReceive(payload); }</code><technical_language>this is bit confusing. I guess serverErrors for deletes. Then, do this. of moving this makePutResponse/makeGetResponse/makeDeleteResponse</technical_language>

Target:
public BoundedByteBufferReceive send(Send send) throws IOException { if (!shouldRespond) { return null; } ServerErrorCode serverError = hardError != null ? hardError : serverErrors.size() > 0 ? serverErrors.poll() : ServerErrorCode.No_Error; RequestOrResponseType type = ((RequestOrResponse) send).getRequestType(); RequestOrResponse response; switch (type) { case PutRequest: response = makePutResponse((PutRequest) send, serverError); break; case GetRequest: response = makeGetResponse((GetRequest) send, serverError); break; case DeleteRequest: response = makeDeleteResponse((DeleteRequest) send, serverError); break; default: throw new IOException("Unknown request type received"); } ByteBufferChannel channel = new ByteBufferChannel(ByteBuffer.allocate((int) response.sizeInBytes())); response.writeTo(channel); ByteBuffer payload = channel.getBuffer(); payload.flip(); BoundedByteBufferReceive boundedByteBufferReceive = new BoundedByteBufferReceive(); boundedByteBufferReceive.readFrom(Channels.newChannel(new ByteBufferInputStream(payload))); return boundedByteBufferReceive; }
Source:
<code>public void testRequestFilters() throws Exception { TestReplicationListener listener = new TestReplicationListener(); PullReplication pullReplication = createPullReplication(); pullReplication.requestFilters.add(new InvalidJSONFilter()); Replicator replicator = ReplicatorFactory.oneway(pullReplication); replicator.getEventBus().register(listener); replicator.start(); while(replicator.getState() != Replicator.State.COMPLETE && replicator.getState() != Replicator.State.ERROR) { <START> Thread.sleep(1000); <END> } Assert.assertEquals(Replicator.State.ERROR, replicator.getState()); Assert.assertFalse(listener.finishCalled); Assert.assertTrue(listener.errorCalled); Assert.assertTrue(listener.exception instanceof CouchException); CouchException couchException = (CouchException) listener.exception; Assert.assertTrue(couchException.getStatusCode() == 400); Assert.assertEquals(couchException.getReason(), "invalid_json"); }</code><technical_language>sleep for a second, 50ms? fewer</technical_language>

Target:
public void testRequestFilters() throws Exception { FilterCallCounter filterCallCounter = new FilterCallCounter(); PullReplication pullReplication = createPullReplication(); pullReplication.requestFilters.add(filterCallCounter); runReplicationUntilComplete(pullReplication); Assert.assertTrue(filterCallCounter.filterRequestTimesCalled >= 1); }
Source:
<code>private Promise<UsersWorkspaceDto> getWorkspaceToStart() { final WorkspaceConfigDto workspaceConfigDto = factory.getWorkspace(); <START> final String create = factory.getPolicies() == null ? "perClick" : factory.getPolicies().getCreate(); <END> switch (create) { case "perUser": return getWorkspaceByConditionOrCreateNew(workspaceConfigDto, new Function<UsersWorkspaceDto, Boolean>() { @Override public Boolean apply(UsersWorkspaceDto existWs) throws FunctionException { return factory.getId().equals(existWs.getAttributes().get(FACTORY_ID_ATTRIBUTE)); } }); case "perAccount": return getWorkspaceByConditionOrCreateNew(workspaceConfigDto, new Function<UsersWorkspaceDto, Boolean>() { @Override public Boolean apply(UsersWorkspaceDto arg) throws FunctionException { return workspaceConfigDto.getName().equals(arg.getName()); } }); case "perClick": default: return getWorkspaceByConditionOrCreateNew(workspaceConfigDto, new Function<UsersWorkspaceDto, Boolean>() { @Override public Boolean apply(UsersWorkspaceDto arg) throws FunctionException { return false; } }); } }</code><technical_language>moving "perClick" constant DEFAULT_POLICY, + i rename local variable policy well, create a bit weird for =)</technical_language>

Target:
private Promise<UsersWorkspaceDto> getWorkspaceToStart() { final WorkspaceConfigDto workspaceConfigDto = factory.getWorkspace(); final String policy = factory.getPolicies() == null ? "perClick" : factory.getPolicies().getCreate(); switch (policy) { case "perUser": return getWorkspaceByConditionOrCreateNew(workspaceConfigDto, new Function<UsersWorkspaceDto, Boolean>() { @Override public Boolean apply(UsersWorkspaceDto existWs) throws FunctionException { return factory.getId().equals(existWs.getAttributes().get(FACTORY_ID_ATTRIBUTE)); } }); case "perAccount": return getWorkspaceByConditionOrCreateNew(workspaceConfigDto, new Function<UsersWorkspaceDto, Boolean>() { @Override public Boolean apply(UsersWorkspaceDto arg) throws FunctionException { return workspaceConfigDto.getName().equals(arg.getName()); } }); case "perClick": default: return getWorkspaceByConditionOrCreateNew(workspaceConfigDto, new Function<UsersWorkspaceDto, Boolean>() { @Override public Boolean apply(UsersWorkspaceDto arg) throws FunctionException { return false; } }); } }
Source:
<code>private void sendMessageToAll(String message) { sessions.forEach( session -> { try { session.getBasicRemote().sendText(message); } catch (IOException e) { LOGGER.error(e.toString()); } <START> } <END> ); }</code><technical_language>code formatted properly? indentation is even</technical_language>

Target:
private void sendMessageToAll(String message) { sessions.forEach(session -> { try { session.getBasicRemote().sendText(message); } catch (IOException e) { logger.error(e.toString()); } }); }
Source:
<code>RequestContext enter(Plugin plugin) { return local.setContext(new PluginRequestContext( <START> userFactory.create(plugin.getName()))); <END> }</code><technical_language>optional: rename userFactory pluginUserFactory obvious this create a PluginUser I looked type of userFactory</technical_language>

Target:
RequestContext enter(Plugin plugin) { return local.setContext(new PluginRequestContext(plugin.getPluginUser())); }
Source:
<code>private void setUpFAB(FloatingActionButton fab) { fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent shareIntent = new Intent(Intent.ACTION_SEND); <START> String text; <END> if (news.getUrl() != null && !news.getUrl().isEmpty()) { text = news.getUrl(); } else { text = Constants.HN_BASE_URL + news.getId(); } shareIntent.putExtra(Intent.EXTRA_TEXT, text); shareIntent.setType(Constants.MIME_TEXT_PLAIN); startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.share))); } }); }</code><technical_language>add title? OH, "Shared Pumpkin Reader for Hacker News. Download Pumpkin Reader for free here"</technical_language>

Target:
private void setUpFAB(FloatingActionButton fab) { fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_SUBJECT, news.getTitle()); String text; if (news.getUrl() != null && !news.getUrl().isEmpty()) { text = news.getUrl(); } else { text = Constants.HN_BASE_URL + news.getId(); } shareIntent.putExtra(Intent.EXTRA_TEXT, text); shareIntent.setType(Constants.MIME_TEXT_PLAIN); startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.share))); } }); }
Source:
<code>public Map<String, DbParameterAccessor> getAllProcedureParameters( String procName) throws SQLException { String[] qualifiers = NameNormaliser.normaliseName(procName).split( "\\."); String cols = "case parmtype when 4 then NULL else parmname end as parmname, parmdomain, length, rtrim(parmmode), parm_id "; String qry = "select " + cols + " from sys.SYSPROCPARMS where 1=1 and "; if (qualifiers.length == 2) { qry += " (upper(creator)=upper(?) and upper(procname)=upper(?)) "; } else { qry += " (creator=user and upper(procname) = upper(?))"; } <START> <END> return readIntoParams(procName, qry); }</code><technical_language>I include order clause arguments sorted position</technical_language>

Target:
public Map<String, DbParameterAccessor> getAllProcedureParameters( String procName) throws SQLException { String[] qualifiers = NameNormaliser.normaliseName(procName).split( "\\."); String cols = "case parmtype when 4 then NULL else parmname end as parmname, parmdomain, length, rtrim(parmmode), parm_id "; String qry = "select " + cols + " from sys.SYSPROCPARMS where 1=1 and "; if (qualifiers.length == 2) { qry += " (upper(creator)=upper(?) and upper(procname)=upper(?)) "; } else { qry += " (creator=user and upper(procname) = upper(?))"; } qry += " order by parm_id "; return readIntoParams(procName, qry); }
Source:
<code>public void pushFileToReview(String testIdent, String refSpec, PrivilegeLevel privilegeLevel, String fileName) throws Exception { changeId = "I" + StringUtils.rightPad(testIdent, 40, "a"); CommitCommand command = createCommitCommand(changeId); addFile(fileName); CommitResult result = commitAndPush(command, refSpec, privilegeLevel); <START> String testMessage = result.push.getMessages(); <END> System.out.println(testMessage); shortId = StringUtils.trimToEmpty(StringUtils.substringAfterLast(result.push.getMessages(), "/")); shortId = StringUtils.removeEnd(shortId, " [DRAFT]"); commitId = result.commit.getId().toString(); assertThat("Bad Push: " + result.push.getMessages(), shortId.length(), greaterThan(0)); }</code><technical_language>Remove this</technical_language>

Target:
public void pushFileToReview(String testIdent, String refSpec, PrivilegeLevel privilegeLevel, String fileName) throws Exception { changeId = "I" + StringUtils.rightPad(testIdent, 40, "a"); CommitCommand command = createCommitCommand(changeId); addFile(fileName); CommitResult result = commitAndPush(command, refSpec, privilegeLevel); shortId = StringUtils.trimToEmpty(StringUtils.substringAfterLast(result.push.getMessages(), "/")); shortId = StringUtils.removeEnd(shortId, " [DRAFT]"); commitId = result.commit.getId().toString(); assertThat("Bad Push: " + result.push.getMessages(), shortId.length(), greaterThan(0)); }
Source:
<code>private HttpMessage createMessage() { HttpMessage message = new HttpMessage(); try { message.getRequestHeader().setURI(new URI("<LINK_0>", false)); } catch (URIException | NullPointerException e) { } return message; <START> } <END></code><technical_language>Add a class variable for extension allow set it, mocked return needed</technical_language>

Target:
private static HttpMessage createMessage() { HttpMessage message = new HttpMessage(); try { message.getRequestHeader().setURI(new URI("<LINK_0>", false)); } catch (URIException | NullPointerException e) { } return message; }
Source:
<code>public Properties getKafkaProducerProperties() { final Properties producerProps = getKafkaProperties(); producerProps.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("acks", "all"); <START> producerProps.put("request.timeout.ms", kafkaSettings.getRequestTimeoutMs()); <END> producerProps.put("batch.size", kafkaSettings.getBatchSize()); producerProps.put("linger.ms", kafkaSettings.getLingerMs()); return producerProps; }</code><technical_language>I understand, in this task, please rename method getKafkaProperties getKafkaConsumerProperties</technical_language>

Target:
public Properties getKafkaProducerProperties() { final Properties producerProps = getKafkaConsumerProperties(); producerProps.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("acks", "all"); producerProps.put("request.timeout.ms", kafkaSettings.getRequestTimeoutMs()); producerProps.put("batch.size", kafkaSettings.getBatchSize()); producerProps.put("linger.ms", kafkaSettings.getLingerMs()); return producerProps; }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.EXCEPT_CLAUSE, ctx -> { ExceptClause exceptClause = (ExceptClause) ctx.syntaxNode(); Map<String, List<Expression>> caughtExceptionsByFQN = new HashMap<>(); Expression exceptionExpression = exceptClause.exception(); if (exceptionExpression == null || !exceptionExpression.is(Tree.Kind.TUPLE)) { return; } Tuple exceptionsTuple = (Tuple) exceptionExpression; <START> exceptionsTuple.elements().forEach(e -> addExceptionExpression(e, caughtExceptionsByFQN)); <END> checkCaughtExceptions(ctx, caughtExceptionsByFQN); }); }</code><technical_language>I nested tuples: python try: ... (A, (B, C)): ... TreeUtils.flattenTuples() get elements</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.EXCEPT_CLAUSE, ctx -> { ExceptClause exceptClause = (ExceptClause) ctx.syntaxNode(); Map<ClassSymbol, List<Expression>> caughtExceptionsBySymbol = new HashMap<>(); Expression exceptionExpression = exceptClause.exception(); if (exceptionExpression == null) { return; } TreeUtils.flattenTuples(exceptionExpression).forEach(e -> addExceptionExpression(e, caughtExceptionsBySymbol)); checkCaughtExceptions(ctx, caughtExceptionsBySymbol); }); }
Source:
<code>public synchronized UserFromAuthProvider getUserInfo(final String internalProviderReference) throws NoUserException, IOException, AuthenticatorSecurityException { Credential credentials = credentialStore.get(internalProviderReference); twitter.setOAuthAccessToken(new AccessToken(credentials.getAccessToken(), credentials.getRefreshToken())); try { twitter4j.User userInfo = twitter.verifyCredentials(); if (userInfo != null) { String givenName = null; String familyName = null; if (userInfo.getName() != null) { String[] names = userInfo.getName().split(" "); if (names.length > 0) { givenName = names[0]; } if (names.length > 1) { familyName = names[1]; } } String email = userInfo.getEmail(); if (null == email) { <START> email = userInfo.getId() + "-twitter"; <END> } return new UserFromAuthProvider(String.valueOf(userInfo.getId()), givenName, familyName, email, EmailVerificationStatus.NOT_VERIFIED, null, null, null); } else { throw new NoUserException(); } } catch (TwitterException e) { throw new IOException(e.getMessage()); } }</code><technical_language>I continue set this DELIVERY_FAILED too</technical_language>

Target:
public synchronized UserFromAuthProvider getUserInfo(final String internalProviderReference) throws NoUserException, IOException, AuthenticatorSecurityException { Credential credentials = credentialStore.get(internalProviderReference); twitter.setOAuthAccessToken(new AccessToken(credentials.getAccessToken(), credentials.getRefreshToken())); try { twitter4j.User userInfo = twitter.verifyCredentials(); if (userInfo != null) { String givenName = null; String familyName = null; if (userInfo.getName() != null) { String[] names = userInfo.getName().split(" "); if (names.length > 0) { givenName = names[0]; } if (names.length > 1) { familyName = names[1]; } } EmailVerificationStatus emailStatus = EmailVerificationStatus.NOT_VERIFIED; String email = userInfo.getEmail(); if (null == email) { email = userInfo.getId() + "-twitter"; emailStatus = EmailVerificationStatus.DELIVERY_FAILED; } return new UserFromAuthProvider(String.valueOf(userInfo.getId()), givenName, familyName, email, emailStatus, null, null, null); } else { throw new NoUserException(); } } catch (TwitterException e) { throw new IOException(e.getMessage()); } }
Source:
<code>void onUpdate(ClickEvent event) { update(); if (Gerrit.isSignedIn()) { <START> persistDiffPreferences(); <END> } }</code><technical_language>This in update() method below, ensuring save preferences if invoked key binding "Enter", setup in constructor</technical_language>

Target:
void onUpdate(ClickEvent event) { update(); }
Source:
<code>public Response toolsIdVersionsVersionIdTypeTestsGet(String type, String id, String versionId, SecurityContext securityContext) throws NotFoundException { if (type == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } SourceFile.FileType fileType = getFileType(type); if (fileType == null) { return Response.status(Response.Status.NOT_FOUND).build(); } switch (fileType) { case DOCKSTORE_CWL: <START> return getFileByToolVersionID(id, versionId, CWL_TEST_JSON, null, false); <END> case DOCKSTORE_WDL: return Response.status(Response.Status.BAD_REQUEST).build(); case DOCKERFILE: return Response.status(Response.Status.BAD_REQUEST).build(); case CWL_TEST_JSON: return getFileByToolVersionID(id, versionId, CWL_TEST_JSON, null, false); case WDL_TEST_JSON: return getFileByToolVersionID(id, versionId, WDL_TEST_JSON, null, false); default: return Response.status(Response.Status.BAD_REQUEST).build(); } }</code><technical_language>This a bad request if DOCKSTORE_WDL is a bad request. valid types test json below</technical_language>

Target:
public Response toolsIdVersionsVersionIdTypeTestsGet(String type, String id, String versionId, SecurityContext securityContext) throws NotFoundException { if (type == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } SourceFile.FileType fileType = getFileType(type); if (fileType == null) { return Response.status(Response.Status.NOT_FOUND).build(); } switch (fileType) { case CWL_TEST_JSON: case DOCKSTORE_CWL: return getFileByToolVersionID(id, versionId, CWL_TEST_JSON, null, false); case WDL_TEST_JSON: case DOCKSTORE_WDL: return getFileByToolVersionID(id, versionId, WDL_TEST_JSON, null, false); case DOCKERFILE: return Response.status(Response.Status.BAD_REQUEST).build(); default: return Response.status(Response.Status.BAD_REQUEST).build(); } }
Source:
<code>public DatabaseClient connect(RuntimeContainer container) throws IOException { MarkLogicConnectionProperties properties = getMarkLogicConnectionProperties(); if (properties.getReferencedComponentId() != null && container != null) { DatabaseClient client = (DatabaseClient) container.getComponentData(container.getCurrentComponentId(), CONNECTION); if (client != null) { return client; } throw new IOException("Referenced component: " + properties.getReferencedComponentId() + " not connected"); } SecurityContext context = "BASIC".equals(properties.authentication.getValue()) ? new DatabaseClientFactory.BasicAuthContext(properties.username.getValue(), properties.password.getValue()) : new DatabaseClientFactory.DigestAuthContext(properties.username.getValue(), properties.password.getValue()); DatabaseClient client = DatabaseClientFactory.newClient(properties.host.getValue(), properties.port.getValue(), properties.database.getValue(), context); <START> client.openTransaction().commit(); <END> LOGGER.info("Connected to MarkLogic server"); if (container != null) { container.setComponentData(container.getCurrentComponentId(), CONNECTION, client); LOGGER.info("Connection stored in container"); } return client; }</code><technical_language>great if separated createConnection testConnection methods please move some method ValidationResult testConnection(ConnectionProperties)</technical_language>

Target:
public DatabaseClient connect(RuntimeContainer container) throws IOException { MarkLogicConnectionProperties properties = getMarkLogicConnectionProperties(); if (properties.getReferencedComponentId() != null && container != null) { DatabaseClient client = (DatabaseClient) container.getComponentData(container.getCurrentComponentId(), CONNECTION); if (client != null) { return client; } throw new IOException("Referenced component: " + properties.getReferencedComponentId() + " not connected"); } SecurityContext context = "BASIC".equals(properties.authentication.getValue()) ? new DatabaseClientFactory.BasicAuthContext(properties.username.getValue(), properties.password.getValue()) : new DatabaseClientFactory.DigestAuthContext(properties.username.getValue(), properties.password.getValue()); DatabaseClient client = DatabaseClientFactory.newClient(properties.host.getValue(), properties.port.getValue(), properties.database.getValue(), context); testConnection(client); LOGGER.info("Connected to MarkLogic server"); if (container != null) { container.setComponentData(container.getCurrentComponentId(), CONNECTION, client); LOGGER.info("Connection stored in container"); } return client; }
Source:
<code>private void connect(final WebSocket webSocket) { new Thread(new Runnable() { @Override public void run() { if (authenticator.getAccessToken() != null) { accessToken = "Bearer " + authenticator.getAccessToken().getAccessToken(); webSocket.addHeader("Authorization", accessToken); try { <START> webSocket.connect(); <END> } catch (WebSocketException e) { e.printStackTrace(); } } } }).start(); }</code><technical_language>If connect call a background thread, updates in a background thread? is a for updates in main thread</technical_language>

Target:
private void connect(final WebSocket webSocket) { new Thread(new Runnable() { @Override public void run() { if (authenticator.getAccessToken() != null) { accessToken = "Bearer " + authenticator.getAccessToken().getAccessToken(); webSocket.addHeader("Authorization", accessToken); webSocket.connectAsynchronously(); } } }).start(); }
Source:
<code><START> public Node visitUnarySend(UnarySendContext ctx) { <END> StatNode statement = (StatNode) visit(ctx.stmt()); String selector = ctx.method.getText(); List<ExprNode> arguments = new ArrayList<>(); return new SendNode(statement, selector, arguments); }</code><technical_language>Some duplication InfixSend</technical_language>

Target:
public Node visitUnarySend(UnarySendContext ctx) { ExprNode expression = (ExprNode) visit(ctx.expr()); String selector = buildSelector(ctx.ID()); List<ExprNode> arguments = new ArrayList<>(); return new SendNode(expression, selector, arguments); }
Source:
<code>public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); try { Method method = osBean.getClass().getMethod("getProcessCpuTime", null); <START> if (!method.isAccessible()) { <END> method.setAccessible(true); } Long l = (Long) method.invoke(osBean); mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", l / NANOSECONDS_PER_SECOND)); } catch ( Exception e ) { LOGGER.log(Level.WARNING, "Could not access process cpu time", e); } mfs.add(new GaugeMetricFamily("process_start_time_seconds","Start time of the process since unix epoch in seconds.", runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); if (unix) { UnixOperatingSystemMXBean unixBean = (UnixOperatingSystemMXBean) osBean; mfs.add(new GaugeMetricFamily("process_open_fds", "Number of open file descriptors.", unixBean.getOpenFileDescriptorCount())); mfs.add(new GaugeMetricFamily("process_max_fds", "Maximum number of open file descriptors.", unixBean.getMaxFileDescriptorCount())); } if (linux) { try { collectMemoryMetricsLinux(mfs); } catch (Exception e) { LOGGER.warning(e.toString()); } } return mfs; }</code><technical_language>do do this</technical_language>

Target:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); try { Method method = osBean.getClass().getMethod("getProcessCpuTime", null); if (!method.isAccessible()) { method.setAccessible(true); } Long l = (Long) method.invoke(osBean); mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", l / NANOSECONDS_PER_SECOND)); } catch (Exception e) { LOGGER.log(Level.FINE,"Could not access process cpu time", e); } mfs.add(new GaugeMetricFamily("process_start_time_seconds", "Start time of the process since unix epoch in seconds.", runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); if (unix) { UnixOperatingSystemMXBean unixBean = (UnixOperatingSystemMXBean) osBean; mfs.add(new GaugeMetricFamily("process_open_fds", "Number of open file descriptors.", unixBean.getOpenFileDescriptorCount())); mfs.add(new GaugeMetricFamily("process_max_fds", "Maximum number of open file descriptors.", unixBean.getMaxFileDescriptorCount())); } if (linux) { try { collectMemoryMetricsLinux(mfs); } catch (Exception e) { LOGGER.warning(e.toString()); } } return mfs; }
Source:
<code>public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) { if (mUfs == null) { Preconditions.checkArgument(path != null, "path may not be null"); return new ManagedBlockingUfsForwarder( <START> new SleepingUnderFileSystem(new AlluxioURI(path), mOptions, conf)); <END> } else { return mUfs; } }</code><technical_language>Instead of wrapping, modify conf set managedblocking true? This sleeping ufs behave more closely normal ufs's (in cases do wrap managed blocking this automatically wrapped either)</technical_language>

Target:
public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) { conf.set(PropertyKey.MASTER_UFS_MANAGED_BLOCKING_ENABLED, true); if (mUfs == null) { Preconditions.checkArgument(path != null, "path may not be null"); return new SleepingUnderFileSystem(new AlluxioURI(path), mOptions, conf); } else { return mUfs; } }
Source:
<code>protected Response unwrapException(HttpRequest request, Throwable e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { <START> return response; <END> } } } jaxrsResponse = executeExceptionMapper(unwrappedException, logger); if (jaxrsResponse != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException, logger); } else { return null; } } }</code><technical_language>@lyind, flow of control drop here, returning response. spec (3.3.4 Exceptions, item 1) If response property of exception entity exception mapping provider (see Section 4.4) is for WebApplicationException sub- class, implementation provider create a new Response instance, response property is directly. If Response is closed, then, in effect, entity. Falling a chance check if "an exception mapping provider (see Section 4.4) is for WebApplicationException sub-class". -Ron</technical_language>

Target:
protected Response unwrapException(HttpRequest request, Throwable e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { } } } jaxrsResponse = executeExceptionMapper(unwrappedException, logger); if (jaxrsResponse != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException, logger); } else { return null; } } }
Source:
<code>public Response createFile( @PathParam ( "pathId" ) String pathId, InputStream fileContents ) { try { checkCorrectExtension( pathId ); fileService.createFile( httpServletRequest.getCharacterEncoding(), pathId, fileContents ); return buildOkResponse(); <START> } catch ( FileService.InvalidNameException t ) { <END> return Response.status( Response.Status.FORBIDDEN ).entity( "containsIllegalCharacters" ).build(); } catch ( Throwable t ) { return buildServerErrorResponse( t ); } }</code><technical_language>Again...</technical_language>

Target:
public Response createFile( @PathParam ( "pathId" ) String pathId, InputStream fileContents ) { try { checkCorrectExtension( pathId ); fileService.createFile( httpServletRequest.getCharacterEncoding(), pathId, fileContents ); return buildOkResponse(); } catch ( FileService.InvalidNameException e ) { return Response.status( Response.Status.FORBIDDEN ).entity( "containsIllegalCharacters" ).build(); } catch ( Throwable t ) { return buildServerErrorResponse( t ); } }
Source:
<code>public void testBasePathOK() throws Exception { FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().replaceBy(Collections.singleton(new CreateFilesForBasePathTest())); ArtifactArchiver archiver = new ArtifactArchiver("**"); archiver.setBasePath("module/dist"); p.getPublishersList().replaceBy(Collections.singleton(archiver)); <START> assertEquals(Result.SUCCESS, build(p)); <END> VirtualFile artifacts = p.getBuildByNumber(1).getArtifactManager().root(); assertTrue(artifacts.child("target").child("file").exists()); }</code><technical_language>j.assertBuildStatus</technical_language>

Target:
public void testBasePathOK() throws Exception { FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().replaceBy(Collections.singleton(new CreateFilesForBasePathTest())); ArtifactArchiver archiver = new ArtifactArchiver("**"); archiver.setBasePath("module/dist"); p.getPublishersList().replaceBy(Collections.singleton(archiver)); j.buildAndAssertSuccess(p); VirtualFile artifacts = p.getBuildByNumber(1).getArtifactManager().root(); assertTrue("file was archived", artifacts.child("target").child("file").exists()); }
Source:
<code>private void buildGraphWithHadoop(GenomixJobConf conf) throws Exception { LOG.info("Building Graph using Hadoop..."); manager.startCluster(ClusterType.HADOOP); GenomixJobConf.tick("buildGraphWithHadoop"); <START> edu.uci.ics.genomix.hadoop.contrailgraphbuilding.GenomixHadoopDriver hadoopDriver = new edu.uci.ics.genomix.hadoop.contrailgraphbuilding.GenomixHadoopDriver(); <END> hadoopDriver.run(prevOutput, curOutput, numCoresPerMachine * numMachines, Integer.parseInt(conf.get(GenomixJobConf.KMER_LENGTH)), 4 * 100000, true, conf); followingBuild = true; manager.stopCluster(ClusterType.HADOOP); LOG.info("Building the graph took " + GenomixJobConf.tock("buildGraphWithHadoop") + "ms"); }</code><technical_language>Hooray! Actually, need fully-qualify this name Hyracks driver-- name before; more specific remove full qualification</technical_language>

Target:
private void buildGraphWithHadoop(GenomixJobConf conf) throws Exception { LOG.info("Building Graph using Hadoop..."); manager.startCluster(ClusterType.HADOOP); GenomixJobConf.tick("buildGraphWithHadoop"); GenomixHadoopDriver hadoopDriver = new GenomixHadoopDriver(); hadoopDriver.run(prevOutput, curOutput, numCoresPerMachine * numMachines, Integer.parseInt(conf.get(GenomixJobConf.KMER_LENGTH)), 4 * 100000, true, conf); followingBuild = true; manager.stopCluster(ClusterType.HADOOP); LOG.info("Building the graph took " + GenomixJobConf.tock("buildGraphWithHadoop") + "ms"); }
Source:
<code>ApolloDynamicConfiguration(URL url) { this.url = url; String configEnv = url.getParameter(APOLLO_ENV_KEY); String configAddr = getAddressWithProtocolPrefix(url); String configCluster = url.getParameter(CLUSTER_KEY); if (configEnv != null) { System.setProperty(APOLLO_ENV_KEY, configEnv); } if (StringUtils.isEmpty(System.getProperty(APOLLO_ENV_KEY)) && !ANYHOST_VALUE.equals(configAddr)) { System.setProperty(APOLLO_ADDR_KEY, configAddr); } if (configCluster != null) { System.setProperty(APOLLO_CLUSTER_KEY, configCluster); } dubboConfig = ConfigService.getConfig(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP)); dubboConfigFile = ConfigService.getConfigFile(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP), ConfigFileFormat.Properties); <START> governanceConfig = ConfigService.getConfig(url.getParameter(CONFIG_GOVERNANCE_NAMESPACE_KEY, DEFAULT_DUBBO_CONFIG_GOVERNANCCE_NAMESPACE)); <END> boolean check = url.getParameter(CHECK_KEY, true); if (dubboConfig.getSourceType() != ConfigSourceType.REMOTE) { if (check) { throw new IllegalStateException("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv)); } else { logger.warn("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv) + ", will use the local cache value instead before eventually the connection is established."); } } }</code><technical_language>CONFIG_GOVERNANCE_NAMESPACE_KEY = CONFIG_NAMESPACE_KEY + ".governance"</technical_language>

Target:
ApolloDynamicConfiguration(URL url) { this.url = url; String configEnv = url.getParameter(APOLLO_ENV_KEY); String configAddr = getAddressWithProtocolPrefix(url); String configCluster = url.getParameter(CLUSTER_KEY); if (configEnv != null) { System.setProperty(APOLLO_ENV_KEY, configEnv); } if (StringUtils.isEmpty(System.getProperty(APOLLO_ENV_KEY)) && !ANYHOST_VALUE.equals(configAddr)) { System.setProperty(APOLLO_ADDR_KEY, configAddr); } if (configCluster != null) { System.setProperty(APOLLO_CLUSTER_KEY, configCluster); } dubboConfig = ConfigService.getConfig(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP)); dubboConfigFile = ConfigService.getConfigFile(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP), ConfigFileFormat.Properties); governanceConfig = ConfigService.getConfig(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP) + CONFIG_GOVERNANCE_NAMESPACE_SUFFIX); boolean check = url.getParameter(CHECK_KEY, true); if (dubboConfig.getSourceType() != ConfigSourceType.REMOTE) { if (check) { throw new IllegalStateException("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv)); } else { logger.warn("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv) + ", will use the local cache value instead before eventually the connection is established."); } } }
Source:
<code>void processReplicaRemovalTask(HashMismatchMessage message) { final RealVoltDB db = (RealVoltDB) VoltDB.instance(); if (db.rejoining() || db.isJoining()) { VoltDB.crashLocalVoltDB("Hash mismatch found before this node could finish " + (db.rejoining() ? "rejoin" : "join") + "As a result, the rejoin operation has been canceled."); return; } if (db.m_leaderAppointer == null || !db.m_leaderAppointer.isLeader()) { return; } synchronized(m_lock) { if (m_replicaRemovalExecutor == null) { <START> m_replicaRemovalExecutor = Executors.newSingleThreadScheduledExecutor( <END> CoreUtils.getThreadFactory("ReplicaRemoval")); } m_replicaRemovalExecutor.schedule(() -> { if (!decommissionReplicas()) { if (tmLog.isDebugEnabled()) { tmLog.debug("@StopReplicas is blocked, reshchedule it."); } m_mailbox.deliver(new HashMismatchMessage()); } }, 2, TimeUnit.SECONDS); } }</code><technical_language>I want is a newScheduledThreadPool(0, CoreUtils.getThreadFactory("ReplicaRemoval")) instead. description, this thread pool thread task finished executing</technical_language>

Target:
void processReplicaRemovalTask(HashMismatchMessage message) { final RealVoltDB db = (RealVoltDB) VoltDB.instance(); if (db.rejoining() || db.isJoining()) { VoltDB.crashLocalVoltDB("Hash mismatch found before this node could finish " + (db.rejoining() ? "rejoin" : "join") + "As a result, the rejoin operation has been canceled."); return; } if (db.m_leaderAppointer == null || !db.m_leaderAppointer.isLeader()) { return; } synchronized(m_lock) { if (m_replicaRemovalExecutor == null) { m_replicaRemovalExecutor = Executors.newSingleThreadScheduledExecutor( CoreUtils.getThreadFactory("ReplicaRemoval")); } if (message.isReschedule()) { if (tmLog.isDebugEnabled()) { tmLog.debug("@StopReplicas is blocked, reshcheduled."); } m_replicaRemovalExecutor.schedule(() -> { if (!decommissionReplicas()) { m_mailbox.deliver(new HashMismatchMessage(true)); } }, 2, TimeUnit.SECONDS); } else { m_replicaRemovalExecutor.submit(() -> { if (!decommissionReplicas()) { m_mailbox.deliver(new HashMismatchMessage(true)); } }); } } }
Source:
<code>public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { logger.trace("Found bean: {}", beanName); <START> if(displayMessages.containsKey(beanName) || beanName.contains("org.springframework.security.authentication.DefaultAuthenticationEventPublisher")) <END> { String displayMessage = displayMessages.getOrDefault(beanName, displayMessages.get("fallback")); progress.onNext(displayMessage); } return bean; }</code><technical_language>DefaultAuthenticationEventPublisher.class.getName() "org.springframework.security.authentication.DefaultAuthenticationEventPublisher". if spring-security-core moves another package drop</technical_language>

Target:
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { logger.trace("Found bean: {}", beanName); if(displayMessages.containsKey(beanName) || beanName.contains(DefaultAuthenticationEventPublisher.class.getName())) { String displayMessage = displayMessages.getOrDefault(beanName, displayMessages.get("fallback")); progress.onNext(displayMessage); } return bean; }
Source:
<code>private ControlGroup(String line) throws NumberFormatException, IndexOutOfBoundsException { String[] fields = line.split(":"); <START> if (fields.length > 1) { id = Integer.parseInt(fields[0]); subsystems = fields[1]; group = fields[2]; } else { id = -1; subsystems = "None"; group = fields[0]; } <END> }</code><technical_language>Need revert this code. id subsystems</technical_language>

Target:
private ControlGroup(String line) throws NumberFormatException, IndexOutOfBoundsException { String[] fields = line.split(":"); id = Integer.parseInt(fields[0]); subsystems = fields[1]; group = fields[2]; }
Source:
<code>public static Set<String> readTerms(String field, Directory directory) throws IOException { <START> DirectoryReader reader = DirectoryReader.open(directory); <END> Set<String> termStrings = new TreeSet<>(); for (AtomicReaderContext atomicReaderContext : reader.leaves()) { AtomicReader atomicReader = atomicReaderContext.reader(); TermsEnum iterator = atomicReader.terms(field).iterator(null); BytesRef next = iterator.next(); while (next != null) { termStrings.add(iterator.term().utf8ToString()); next = iterator.next(); } } return termStrings; }</code><technical_language>forget close this one</technical_language>

Target:
public static Set<String> readTerms(String field, Directory directory) throws IOException { try (DirectoryReader reader = DirectoryReader.open(directory)) { Set<String> termStrings = new TreeSet<>(); for (AtomicReaderContext atomicReaderContext : reader.leaves()) { AtomicReader atomicReader = atomicReaderContext.reader(); TermsEnum iterator = atomicReader.terms(field).iterator(null); BytesRef next = iterator.next(); while (next != null) { termStrings.add(iterator.term().utf8ToString()); next = iterator.next(); } } return termStrings; } }
Source:
<code>public void shutdown() { fShutdown = true; <START> Job.getJobManager().cancel(AbstractDispatchJob.class); <END> }</code><technical_language>This is wrong, this try cancel *all possible* dispatcher jobs, jobs of current dispatcher</technical_language>

Target:
public void shutdown() { fShutdown = true; Job.getJobManager().cancel(this); }
Source:
<code>private void renderFlatTable(StringBuilder tableBuilder, String id, String header, ModelUsageData treeItem) { tableBuilder.append("<table id='summary-" + id + "' class='tablesorter nicetable noauto'>"); tableBuilder.append(renderCaption(id, header, true)); tableBuilder.append( "<thead><tr><th>Class</th><th>Instances Injected</th><th>Total Init Time [ms]</th class=\"{sorter: 'floating'}\"><th>Avg. Init Time [ms]</th></tr></thead><tbody>"); for (Entry<Class<?>, ModelUsageData> entry : flattenStats(treeItem).entrySet()) { ModelUsageData stats = entry.getValue(); Long instancesCount = stats.getCount(); Long totalTime = stats.getTotalTime(); double avgTime = stats.getAverageTime(); tableBuilder.append("<tr><td>"); tableBuilder.append(entry.getKey().getName()); tableBuilder.append("</td><td>"); tableBuilder.append(instancesCount.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(totalTime.toString()); <START> tableBuilder.append("</td><td>"); <END> tableBuilder.append(String.format("%.3f", avgTime)); tableBuilder.append("</td></tr>"); } tableBuilder.append("</tbody></table>"); tableBuilder.append("<script>$(document).ready(function() {$('#summary-" + id + "').tablesorter({sortList:[[2,1]]})});</script>"); }</code><technical_language>creating a method render a single cell instead of calling this time time again</technical_language>

Target:
private void renderFlatTable(StringBuilder tableBuilder, String id, String header, ModelUsageData treeItem) { tableBuilder.append("<table id='summary-" + id + "' class='tablesorter nicetable noauto'>"); tableBuilder.append(renderCaption(id, header, true)); tableBuilder.append( "<thead><tr><th>Class</th><th>Instances Injected</th><th>Total Init Time [ms]</th class=\"{sorter: 'floating'}\"><th>Avg. Init Time [ms]</th></tr></thead><tbody>"); for (Entry<Class<?>, ModelUsageData> entry : flattenStats(treeItem).entrySet()) { ModelUsageData stats = entry.getValue(); Long instancesCount = stats.getCount(); Long totalTime = stats.getTotalTimeInMillis(); double avgTime = stats.getAverageTimeInMillis(); tableBuilder.append("<tr><td>"); tableBuilder.append(entry.getKey().getName()); tableBuilder.append("</td><td>"); tableBuilder.append(instancesCount.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(totalTime.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(String.format("%.3f", avgTime)); tableBuilder.append("</td></tr>"); } tableBuilder.append("</tbody></table>"); tableBuilder.append("<script>$(document).ready(function() {$('#summary-" + id + "').tablesorter({sortList:[[2,1]]})});</script>"); }
Source:
<code>public void setUp() { dummyRequest = new DummyHttpServletRequestUser(); <START> dummyRequest.setHeader("authorization", "Basic Zm9vOmJhcg=="); <END> }</code><technical_language>blocking; this is for test in related method</technical_language>

Target:
public void setUp() { dummyRequest = new DummyHttpServletRequestUser(); }
Source:
<code>private static long parseUnsignedHex(String s) { <START> <END> final long a = Long.parseLong(s.substring(1), 16); long b = Long.parseLong(s.substring(0, 1), 16); b <<= 60; return a | b; }</code><technical_language>Style-nit: put a blank line start of a method</technical_language>

Target:
private static long parseUnsignedHex(String s) { final long h = Long.parseLong(s.substring(0, 1), 16); final long l = Long.parseLong(s.substring(1), 16); return (h << 60) | l; }