You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RevCommit.java 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /*
  2. * Copyright (C) 2008-2009, Google Inc.
  3. * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
  4. * and other copyright owners as documented in the project's IP log.
  5. *
  6. * This program and the accompanying materials are made available
  7. * under the terms of the Eclipse Distribution License v1.0 which
  8. * accompanies this distribution, is reproduced below, and is
  9. * available at http://www.eclipse.org/org/documents/edl-v10.php
  10. *
  11. * All rights reserved.
  12. *
  13. * Redistribution and use in source and binary forms, with or
  14. * without modification, are permitted provided that the following
  15. * conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright
  18. * notice, this list of conditions and the following disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials provided
  23. * with the distribution.
  24. *
  25. * - Neither the name of the Eclipse Foundation, Inc. nor the
  26. * names of its contributors may be used to endorse or promote
  27. * products derived from this software without specific prior
  28. * written permission.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  31. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  32. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  33. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  34. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  35. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  39. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  41. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  42. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43. */
  44. package org.eclipse.jgit.revwalk;
  45. import java.io.IOException;
  46. import java.nio.charset.Charset;
  47. import java.util.ArrayList;
  48. import java.util.Collections;
  49. import java.util.List;
  50. import org.eclipse.jgit.errors.IncorrectObjectTypeException;
  51. import org.eclipse.jgit.errors.MissingObjectException;
  52. import org.eclipse.jgit.lib.AnyObjectId;
  53. import org.eclipse.jgit.lib.Constants;
  54. import org.eclipse.jgit.lib.MutableObjectId;
  55. import org.eclipse.jgit.lib.ObjectInserter;
  56. import org.eclipse.jgit.lib.ObjectReader;
  57. import org.eclipse.jgit.lib.PersonIdent;
  58. import org.eclipse.jgit.util.RawParseUtils;
  59. import org.eclipse.jgit.util.StringUtils;
  60. /** A commit reference to a commit in the DAG. */
  61. public class RevCommit extends RevObject {
  62. private static final int STACK_DEPTH = 500;
  63. /**
  64. * Parse a commit from its canonical format.
  65. *
  66. * This method constructs a temporary revision pool, parses the commit as
  67. * supplied, and returns it to the caller. Since the commit was built inside
  68. * of a private revision pool its parent pointers will be initialized, but
  69. * will not have their headers loaded.
  70. *
  71. * Applications are discouraged from using this API. Callers usually need
  72. * more than one commit. Use {@link RevWalk#parseCommit(AnyObjectId)} to
  73. * obtain a RevCommit from an existing repository.
  74. *
  75. * @param raw
  76. * the canonical formatted commit to be parsed.
  77. * @return the parsed commit, in an isolated revision pool that is not
  78. * available to the caller.
  79. */
  80. public static RevCommit parse(byte[] raw) {
  81. try {
  82. return parse(new RevWalk((ObjectReader) null), raw);
  83. } catch (IOException ex) {
  84. throw new RuntimeException(ex);
  85. }
  86. }
  87. /**
  88. * Parse a commit from its canonical format.
  89. *
  90. * This method inserts the commit directly into the caller supplied revision
  91. * pool, making it appear as though the commit exists in the repository,
  92. * even if it doesn't. The repository under the pool is not affected.
  93. *
  94. * @param rw
  95. * the revision pool to allocate the commit within. The commit's
  96. * tree and parent pointers will be obtained from this pool.
  97. * @param raw
  98. * the canonical formatted commit to be parsed.
  99. * @return the parsed commit, in an isolated revision pool that is not
  100. * available to the caller.
  101. * @throws IOException
  102. * in case of RevWalk initialization fails
  103. */
  104. public static RevCommit parse(RevWalk rw, byte[] raw) throws IOException {
  105. ObjectInserter.Formatter fmt = new ObjectInserter.Formatter();
  106. boolean retain = rw.isRetainBody();
  107. rw.setRetainBody(true);
  108. RevCommit r = rw.lookupCommit(fmt.idFor(Constants.OBJ_COMMIT, raw));
  109. r.parseCanonical(rw, raw);
  110. rw.setRetainBody(retain);
  111. return r;
  112. }
  113. static final RevCommit[] NO_PARENTS = {};
  114. private RevTree tree;
  115. RevCommit[] parents;
  116. int commitTime; // An int here for performance, overflows in 2038
  117. int inDegree;
  118. private byte[] buffer;
  119. /**
  120. * Create a new commit reference.
  121. *
  122. * @param id
  123. * object name for the commit.
  124. */
  125. protected RevCommit(final AnyObjectId id) {
  126. super(id);
  127. }
  128. @Override
  129. void parseHeaders(final RevWalk walk) throws MissingObjectException,
  130. IncorrectObjectTypeException, IOException {
  131. parseCanonical(walk, walk.getCachedBytes(this));
  132. }
  133. @Override
  134. void parseBody(final RevWalk walk) throws MissingObjectException,
  135. IncorrectObjectTypeException, IOException {
  136. if (buffer == null) {
  137. buffer = walk.getCachedBytes(this);
  138. if ((flags & PARSED) == 0)
  139. parseCanonical(walk, buffer);
  140. }
  141. }
  142. void parseCanonical(final RevWalk walk, final byte[] raw)
  143. throws IOException {
  144. if (!walk.shallowCommitsInitialized)
  145. walk.initializeShallowCommits();
  146. final MutableObjectId idBuffer = walk.idBuffer;
  147. idBuffer.fromString(raw, 5);
  148. tree = walk.lookupTree(idBuffer);
  149. int ptr = 46;
  150. if (parents == null) {
  151. RevCommit[] pList = new RevCommit[1];
  152. int nParents = 0;
  153. for (;;) {
  154. if (raw[ptr] != 'p')
  155. break;
  156. idBuffer.fromString(raw, ptr + 7);
  157. final RevCommit p = walk.lookupCommit(idBuffer);
  158. if (nParents == 0)
  159. pList[nParents++] = p;
  160. else if (nParents == 1) {
  161. pList = new RevCommit[] { pList[0], p };
  162. nParents = 2;
  163. } else {
  164. if (pList.length <= nParents) {
  165. RevCommit[] old = pList;
  166. pList = new RevCommit[pList.length + 32];
  167. System.arraycopy(old, 0, pList, 0, nParents);
  168. }
  169. pList[nParents++] = p;
  170. }
  171. ptr += 48;
  172. }
  173. if (nParents != pList.length) {
  174. RevCommit[] old = pList;
  175. pList = new RevCommit[nParents];
  176. System.arraycopy(old, 0, pList, 0, nParents);
  177. }
  178. parents = pList;
  179. }
  180. // extract time from "committer "
  181. ptr = RawParseUtils.committer(raw, ptr);
  182. if (ptr > 0) {
  183. ptr = RawParseUtils.nextLF(raw, ptr, '>');
  184. // In 2038 commitTime will overflow unless it is changed to long.
  185. commitTime = RawParseUtils.parseBase10(raw, ptr, null);
  186. }
  187. if (walk.isRetainBody())
  188. buffer = raw;
  189. flags |= PARSED;
  190. }
  191. @Override
  192. public final int getType() {
  193. return Constants.OBJ_COMMIT;
  194. }
  195. static void carryFlags(RevCommit c, int carry) {
  196. FIFORevQueue q = carryFlags1(c, carry, 0);
  197. if (q != null)
  198. slowCarryFlags(q, carry);
  199. }
  200. private static FIFORevQueue carryFlags1(RevCommit c, int carry, int depth) {
  201. for(;;) {
  202. RevCommit[] pList = c.parents;
  203. if (pList == null || pList.length == 0)
  204. return null;
  205. if (pList.length != 1) {
  206. if (depth == STACK_DEPTH)
  207. return defer(c);
  208. for (int i = 1; i < pList.length; i++) {
  209. RevCommit p = pList[i];
  210. if ((p.flags & carry) == carry)
  211. continue;
  212. p.flags |= carry;
  213. FIFORevQueue q = carryFlags1(c, carry, depth + 1);
  214. if (q != null)
  215. return defer(q, carry, pList, i + 1);
  216. }
  217. }
  218. c = pList[0];
  219. if ((c.flags & carry) == carry)
  220. return null;
  221. c.flags |= carry;
  222. }
  223. }
  224. private static FIFORevQueue defer(RevCommit c) {
  225. FIFORevQueue q = new FIFORevQueue();
  226. q.add(c);
  227. return q;
  228. }
  229. private static FIFORevQueue defer(FIFORevQueue q, int carry,
  230. RevCommit[] pList, int i) {
  231. // In normal case the caller will run pList[0] in a tail recursive
  232. // fashion by updating the variable. However the caller is unwinding
  233. // the stack and will skip that pList[0] execution step.
  234. carryOneStep(q, carry, pList[0]);
  235. // Remaining parents (if any) need to have flags checked and be
  236. // enqueued if they have ancestors.
  237. for (; i < pList.length; i++)
  238. carryOneStep(q, carry, pList[i]);
  239. return q;
  240. }
  241. private static void slowCarryFlags(FIFORevQueue q, int carry) {
  242. // Commits in q have non-null parent arrays and have set all
  243. // flags in carry. This loop finishes copying over the graph.
  244. for (RevCommit c; (c = q.next()) != null;) {
  245. for (RevCommit p : c.parents)
  246. carryOneStep(q, carry, p);
  247. }
  248. }
  249. private static void carryOneStep(FIFORevQueue q, int carry, RevCommit c) {
  250. if ((c.flags & carry) != carry) {
  251. c.flags |= carry;
  252. if (c.parents != null)
  253. q.add(c);
  254. }
  255. }
  256. /**
  257. * Carry a RevFlag set on this commit to its parents.
  258. * <p>
  259. * If this commit is parsed, has parents, and has the supplied flag set on
  260. * it we automatically add it to the parents, grand-parents, and so on until
  261. * an unparsed commit or a commit with no parents is discovered. This
  262. * permits applications to force a flag through the history chain when
  263. * necessary.
  264. *
  265. * @param flag
  266. * the single flag value to carry back onto parents.
  267. */
  268. public void carry(final RevFlag flag) {
  269. final int carry = flags & flag.mask;
  270. if (carry != 0)
  271. carryFlags(this, carry);
  272. }
  273. /**
  274. * Time from the "committer " line of the buffer.
  275. *
  276. * @return time, expressed as seconds since the epoch.
  277. */
  278. public final int getCommitTime() {
  279. return commitTime;
  280. }
  281. /**
  282. * Get a reference to this commit's tree.
  283. *
  284. * @return tree of this commit.
  285. */
  286. public final RevTree getTree() {
  287. return tree;
  288. }
  289. /**
  290. * Get the number of parent commits listed in this commit.
  291. *
  292. * @return number of parents; always a positive value but can be 0.
  293. */
  294. public final int getParentCount() {
  295. return parents.length;
  296. }
  297. /**
  298. * Get the nth parent from this commit's parent list.
  299. *
  300. * @param nth
  301. * parent index to obtain. Must be in the range 0 through
  302. * {@link #getParentCount()}-1.
  303. * @return the specified parent.
  304. * @throws ArrayIndexOutOfBoundsException
  305. * an invalid parent index was specified.
  306. */
  307. public final RevCommit getParent(final int nth) {
  308. return parents[nth];
  309. }
  310. /**
  311. * Obtain an array of all parents (<b>NOTE - THIS IS NOT A COPY</b>).
  312. * <p>
  313. * This method is exposed only to provide very fast, efficient access to
  314. * this commit's parent list. Applications relying on this list should be
  315. * very careful to ensure they do not modify its contents during their use
  316. * of it.
  317. *
  318. * @return the array of parents.
  319. */
  320. public final RevCommit[] getParents() {
  321. return parents;
  322. }
  323. /**
  324. * Obtain the raw unparsed commit body (<b>NOTE - THIS IS NOT A COPY</b>).
  325. * <p>
  326. * This method is exposed only to provide very fast, efficient access to
  327. * this commit's message buffer within a RevFilter. Applications relying on
  328. * this buffer should be very careful to ensure they do not modify its
  329. * contents during their use of it.
  330. *
  331. * @return the raw unparsed commit body. This is <b>NOT A COPY</b>.
  332. * Altering the contents of this buffer may alter the walker's
  333. * knowledge of this commit, and the results it produces.
  334. */
  335. public final byte[] getRawBuffer() {
  336. return buffer;
  337. }
  338. /**
  339. * Parse the author identity from the raw buffer.
  340. * <p>
  341. * This method parses and returns the content of the author line, after
  342. * taking the commit's character set into account and decoding the author
  343. * name and email address. This method is fairly expensive and produces a
  344. * new PersonIdent instance on each invocation. Callers should invoke this
  345. * method only if they are certain they will be outputting the result, and
  346. * should cache the return value for as long as necessary to use all
  347. * information from it.
  348. * <p>
  349. * RevFilter implementations should try to use {@link RawParseUtils} to scan
  350. * the {@link #getRawBuffer()} instead, as this will allow faster evaluation
  351. * of commits.
  352. *
  353. * @return identity of the author (name, email) and the time the commit was
  354. * made by the author; null if no author line was found.
  355. */
  356. public final PersonIdent getAuthorIdent() {
  357. final byte[] raw = buffer;
  358. final int nameB = RawParseUtils.author(raw, 0);
  359. if (nameB < 0)
  360. return null;
  361. return RawParseUtils.parsePersonIdent(raw, nameB);
  362. }
  363. /**
  364. * Parse the committer identity from the raw buffer.
  365. * <p>
  366. * This method parses and returns the content of the committer line, after
  367. * taking the commit's character set into account and decoding the committer
  368. * name and email address. This method is fairly expensive and produces a
  369. * new PersonIdent instance on each invocation. Callers should invoke this
  370. * method only if they are certain they will be outputting the result, and
  371. * should cache the return value for as long as necessary to use all
  372. * information from it.
  373. * <p>
  374. * RevFilter implementations should try to use {@link RawParseUtils} to scan
  375. * the {@link #getRawBuffer()} instead, as this will allow faster evaluation
  376. * of commits.
  377. *
  378. * @return identity of the committer (name, email) and the time the commit
  379. * was made by the committer; null if no committer line was found.
  380. */
  381. public final PersonIdent getCommitterIdent() {
  382. final byte[] raw = buffer;
  383. final int nameB = RawParseUtils.committer(raw, 0);
  384. if (nameB < 0)
  385. return null;
  386. return RawParseUtils.parsePersonIdent(raw, nameB);
  387. }
  388. /**
  389. * Parse the complete commit message and decode it to a string.
  390. * <p>
  391. * This method parses and returns the message portion of the commit buffer,
  392. * after taking the commit's character set into account and decoding the
  393. * buffer using that character set. This method is a fairly expensive
  394. * operation and produces a new string on each invocation.
  395. *
  396. * @return decoded commit message as a string. Never null.
  397. */
  398. public final String getFullMessage() {
  399. final byte[] raw = buffer;
  400. final int msgB = RawParseUtils.commitMessage(raw, 0);
  401. if (msgB < 0)
  402. return ""; //$NON-NLS-1$
  403. final Charset enc = RawParseUtils.parseEncoding(raw);
  404. return RawParseUtils.decode(enc, raw, msgB, raw.length);
  405. }
  406. /**
  407. * Parse the commit message and return the first "line" of it.
  408. * <p>
  409. * The first line is everything up to the first pair of LFs. This is the
  410. * "oneline" format, suitable for output in a single line display.
  411. * <p>
  412. * This method parses and returns the message portion of the commit buffer,
  413. * after taking the commit's character set into account and decoding the
  414. * buffer using that character set. This method is a fairly expensive
  415. * operation and produces a new string on each invocation.
  416. *
  417. * @return decoded commit message as a string. Never null. The returned
  418. * string does not contain any LFs, even if the first paragraph
  419. * spanned multiple lines. Embedded LFs are converted to spaces.
  420. */
  421. public final String getShortMessage() {
  422. final byte[] raw = buffer;
  423. final int msgB = RawParseUtils.commitMessage(raw, 0);
  424. if (msgB < 0)
  425. return ""; //$NON-NLS-1$
  426. final Charset enc = RawParseUtils.parseEncoding(raw);
  427. final int msgE = RawParseUtils.endOfParagraph(raw, msgB);
  428. String str = RawParseUtils.decode(enc, raw, msgB, msgE);
  429. if (hasLF(raw, msgB, msgE))
  430. str = StringUtils.replaceLineBreaksWithSpace(str);
  431. return str;
  432. }
  433. static boolean hasLF(final byte[] r, int b, final int e) {
  434. while (b < e)
  435. if (r[b++] == '\n')
  436. return true;
  437. return false;
  438. }
  439. /**
  440. * Determine the encoding of the commit message buffer.
  441. * <p>
  442. * Locates the "encoding" header (if present) and then returns the proper
  443. * character set to apply to this buffer to evaluate its contents as
  444. * character data.
  445. * <p>
  446. * If no encoding header is present, {@link Constants#CHARSET} is assumed.
  447. *
  448. * @return the preferred encoding of {@link #getRawBuffer()}.
  449. */
  450. public final Charset getEncoding() {
  451. return RawParseUtils.parseEncoding(buffer);
  452. }
  453. /**
  454. * Parse the footer lines (e.g. "Signed-off-by") for machine processing.
  455. * <p>
  456. * This method splits all of the footer lines out of the last paragraph of
  457. * the commit message, providing each line as a key-value pair, ordered by
  458. * the order of the line's appearance in the commit message itself.
  459. * <p>
  460. * A footer line's key must match the pattern {@code ^[A-Za-z0-9-]+:}, while
  461. * the value is free-form, but must not contain an LF. Very common keys seen
  462. * in the wild are:
  463. * <ul>
  464. * <li>{@code Signed-off-by} (agrees to Developer Certificate of Origin)
  465. * <li>{@code Acked-by} (thinks change looks sane in context)
  466. * <li>{@code Reported-by} (originally found the issue this change fixes)
  467. * <li>{@code Tested-by} (validated change fixes the issue for them)
  468. * <li>{@code CC}, {@code Cc} (copy on all email related to this change)
  469. * <li>{@code Bug} (link to project's bug tracking system)
  470. * </ul>
  471. *
  472. * @return ordered list of footer lines; empty list if no footers found.
  473. */
  474. public final List<FooterLine> getFooterLines() {
  475. final byte[] raw = buffer;
  476. int ptr = raw.length - 1;
  477. while (raw[ptr] == '\n') // trim any trailing LFs, not interesting
  478. ptr--;
  479. final int msgB = RawParseUtils.commitMessage(raw, 0);
  480. final ArrayList<FooterLine> r = new ArrayList<FooterLine>(4);
  481. final Charset enc = getEncoding();
  482. for (;;) {
  483. ptr = RawParseUtils.prevLF(raw, ptr);
  484. if (ptr <= msgB)
  485. break; // Don't parse commit headers as footer lines.
  486. final int keyStart = ptr + 2;
  487. if (raw[keyStart] == '\n')
  488. break; // Stop at first paragraph break, no footers above it.
  489. final int keyEnd = RawParseUtils.endOfFooterLineKey(raw, keyStart);
  490. if (keyEnd < 0)
  491. continue; // Not a well formed footer line, skip it.
  492. // Skip over the ': *' at the end of the key before the value.
  493. //
  494. int valStart = keyEnd + 1;
  495. while (valStart < raw.length && raw[valStart] == ' ')
  496. valStart++;
  497. // Value ends at the LF, and does not include it.
  498. //
  499. int valEnd = RawParseUtils.nextLF(raw, valStart);
  500. if (raw[valEnd - 1] == '\n')
  501. valEnd--;
  502. r.add(new FooterLine(raw, enc, keyStart, keyEnd, valStart, valEnd));
  503. }
  504. Collections.reverse(r);
  505. return r;
  506. }
  507. /**
  508. * Get the values of all footer lines with the given key.
  509. *
  510. * @param keyName
  511. * footer key to find values of, case insensitive.
  512. * @return values of footers with key of {@code keyName}, ordered by their
  513. * order of appearance. Duplicates may be returned if the same
  514. * footer appeared more than once. Empty list if no footers appear
  515. * with the specified key, or there are no footers at all.
  516. * @see #getFooterLines()
  517. */
  518. public final List<String> getFooterLines(final String keyName) {
  519. return getFooterLines(new FooterKey(keyName));
  520. }
  521. /**
  522. * Get the values of all footer lines with the given key.
  523. *
  524. * @param keyName
  525. * footer key to find values of, case insensitive.
  526. * @return values of footers with key of {@code keyName}, ordered by their
  527. * order of appearance. Duplicates may be returned if the same
  528. * footer appeared more than once. Empty list if no footers appear
  529. * with the specified key, or there are no footers at all.
  530. * @see #getFooterLines()
  531. */
  532. public final List<String> getFooterLines(final FooterKey keyName) {
  533. final List<FooterLine> src = getFooterLines();
  534. if (src.isEmpty())
  535. return Collections.emptyList();
  536. final ArrayList<String> r = new ArrayList<String>(src.size());
  537. for (final FooterLine f : src) {
  538. if (f.matches(keyName))
  539. r.add(f.getValue());
  540. }
  541. return r;
  542. }
  543. /**
  544. * Reset this commit to allow another RevWalk with the same instances.
  545. * <p>
  546. * Subclasses <b>must</b> call <code>super.reset()</code> to ensure the
  547. * basic information can be correctly cleared out.
  548. */
  549. public void reset() {
  550. inDegree = 0;
  551. }
  552. final void disposeBody() {
  553. buffer = null;
  554. }
  555. @Override
  556. public String toString() {
  557. final StringBuilder s = new StringBuilder();
  558. s.append(Constants.typeString(getType()));
  559. s.append(' ');
  560. s.append(name());
  561. s.append(' ');
  562. s.append(commitTime);
  563. s.append(' ');
  564. appendCoreFlags(s);
  565. return s.toString();
  566. }
  567. }