auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public T transformParallel(T root, TraverserVisitor<T> traverserVisitor, Map<Class<?>, Object> rootVars) { assertNotNull(root); TraverserVisitor<T> nodeTraverserVisitor = new TraverserVisitor<T>() { @Override public TraversalControl enter(TraverserContext<T> context) { NodeZipper<T> nodeZipper = new NodeZipper<>(context.thisNode(), context.getBreadcrumbs(), nodeAdapter); context.setVar(NodeZipper.class, nodeZipper); context.setVar(NodeAdapter.class, nodeAdapter); return traverserVisitor.enter(context); } @Override public TraversalControl leave(TraverserContext<T> context) { return Assert.assertShouldNeverHappen("not supposed to be called for parallel traversing"); } }; Queue<NodeZipper<T>> zippers = new ConcurrentLinkedQueue<>(); <START> ParallelTraverser<T> traverser = ParallelTraverser.parallelTraverserWithNamedChildren(nodeAdapter::getNamedChildren, zippers); <END> traverser.rootVars(rootVars); traverser.traverse(root, nodeTraverserVisitor); NodeMultiZipper<T> multiZipper = NodeMultiZipper.newNodeMultiZipperTrusted(root, new ArrayList<>(zippers), nodeAdapter); return multiZipper.toRootNode(); }</code><technical_language>default choice of ForkJoin pool is platform common pool. I needs "varially" outer limit. while platform default is in cases - for graphql-java choose</technical_language>

Target:
public T transformParallel(T root, TraverserVisitor<T> traverserVisitor, Map<Class<?>, Object> rootVars) { return transformParallel(root, traverserVisitor, rootVars, ForkJoinPool.commonPool()); }
Source:
<code>public void startContainer(String containerId) throws DockerAccessException { try { String url = urlBuilder.startContainer(containerId); <START> log.verbose(Logger.LogVerboseCategory.API,"POSTing %s", url); <END> delegate.post(url, HTTP_NO_CONTENT, HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to start container id [%s]", containerId); } }</code><technical_language>suggestion log.verbose(Logger.LogVerboseCategory.API,"POST %s", url);</technical_language>

Target:
public void startContainer(String containerId) throws DockerAccessException { try { String url = urlBuilder.startContainer(containerId); log.verbose(Logger.LogVerboseCategory.API,"POST %s", url); delegate.post(url, HTTP_NO_CONTENT, HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to start container id [%s]", containerId); } }
Source:
<code>public boolean uploadBlob(BlobId blobId, long blobSize, InputStream blobInputStream) throws Exception { Objects.requireNonNull(blobId, "BlobId cannot be null"); Objects.requireNonNull(blobInputStream, "Input stream cannot be null"); BlobRequestOptions options = null; OperationContext opContext = null; try { CloudBlobContainer azureContainer = getContainer(blobId, true); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(blobId.getID()); if (azureBlob.exists()) { LOGGER.debug("Skipping upload of blob as it already exists in Azure container {}.", blobId, azureContainer.getName()); return false; } azureBlob.upload(blobInputStream, blobSize, null, options, opContext); LOGGER.debug("Uploaded blob to Azure container {}.", blobId, azureContainer.getName()); return true; <START> } catch (Exception e) { <END> LOGGER.error("Failed to upload blob: " + blobId); throw e; } }</code><technical_language>question Exception. throw StorageException URISyntaxException in line 67, is compatible interface. Do need cast Exception here</technical_language>

Target:
public boolean uploadBlob(BlobId blobId, long blobSize, InputStream blobInputStream) throws CloudStorageException { Objects.requireNonNull(blobId, "BlobId cannot be null"); Objects.requireNonNull(blobInputStream, "Input stream cannot be null"); BlobRequestOptions options = null; OperationContext opContext = null; try { CloudBlobContainer azureContainer = getContainer(blobId, true); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(blobId.getID()); if (azureBlob.exists()) { LOGGER.debug("Skipping upload of blob as it already exists in Azure container {}.", blobId, azureContainer.getName()); return false; } azureBlob.upload(blobInputStream, blobSize, null, options, opContext); LOGGER.debug("Uploaded blob to Azure container {}.", blobId, azureContainer.getName()); return true; } catch (URISyntaxException | StorageException | IOException e) { throw new CloudStorageException("Failed to upload blob: " + blobId, e); } }
Source:
<code>public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (isErrorControllerRelated(request)) { if (log.isDebugEnabled()) { log.debug("Skipping creation of a span for error controller processing"); } return true; } String spanName = spanName(handler); <START> Span span = getTracer().createSpan(SpanNameUtil.toLowerHyphen(spanName)); <END> if (log.isDebugEnabled()) { log.debug("Created new span " + span + " with name [" + spanName + "]"); } addClassMethodTag(handler, span); addClassNameTag(handler, span); setSpanInAttribute(request, span); return true; }</code><technical_language>nit: toLowerHyphen spanName function</technical_language>

Target:
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (isErrorControllerRelated(request)) { log.debug("Skipping creation of a span for error controller processing"); return true; } if (isSpanContinued(request)) { log.debug("Skipping creation of a span since the span is continued"); return true; } String spanName = spanName(handler); Span span = getTracer().createSpan(spanName); if (log.isDebugEnabled()) { log.debug("Created new span " + span + " with name [" + spanName + "]"); } addClassMethodTag(handler, span); addClassNameTag(handler, span); setSpanInAttribute(request, span); return true; }
Source:
<code>public int updateWaitingRequest(long ts, Request request, Long initialSector) { Pair<Request, Integer> reqQuark = fWaitingQueue.get(initialSector); if (reqQuark == null) { return addWaitingRequest(ts, request); } else if (!initialSector.equals(request.getSector())) { fWaitingQueue.remove(initialSector); fWaitingQueue.put(request.getSector(), reqQuark); } int slotQuark = reqQuark.getSecond(); try { int currentRequestQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.CURRENT_REQUEST); fSs.modifyAttribute(ts, request.getSector(), currentRequestQuark); int requestSizeQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.REQUEST_SIZE); fSs.modifyAttribute(ts, request.getNrSector(), requestSizeQuark); int mergedInQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.MERGED_IN); fSs.modifyAttribute(ts, <START> TmfStateValue.nullValue().unboxValue(), mergedInQuark); <END> } catch (StateValueTypeException e) { Activator.getDefault().logError("Error inserting request", e); } updateQueuesLength(ts); return slotQuark; }</code><technical_language>nan</technical_language>

Target:
public int updateWaitingRequest(long ts, Request request, Long initialSector) { Pair<Request, Integer> reqQuark = fWaitingQueue.get(initialSector); if (reqQuark == null) { return addWaitingRequest(ts, request); } else if (!initialSector.equals(request.getSector())) { fWaitingQueue.remove(initialSector); fWaitingQueue.put(request.getSector(), reqQuark); } int slotQuark = reqQuark.getSecond(); try { int currentRequestQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.CURRENT_REQUEST); fSs.modifyAttribute(ts, request.getSector(), currentRequestQuark); int requestSizeQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.REQUEST_SIZE); fSs.modifyAttribute(ts, request.getNrSector(), requestSizeQuark); int mergedInQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.MERGED_IN); fSs.modifyAttribute(ts, (Object) null, mergedInQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error inserting request", e); } updateQueuesLength(ts); return slotQuark; }
Source:
<code>public Python(String n) { super(n); subscribe(Runtime.getInstance().getName(), "registered"); log.info("created python {}", getName()); log.info("creating module directory pythonModules"); new File("pythonModules").mkdir(); ServiceData sd = ServiceData.getLocalInstance(); Platform p = Platform.getLocalInstance(); List<ServiceType> sdt = sd.getAvailableServiceTypes(); for (int i = 0; i < sdt.size(); ++i) { ServiceType st = sdt.get(i); <START> String url = String.format("%s/%s.py", st.getSimpleName(), st.getSimpleName()); <END> exampleUrls.put(st.getSimpleName(), url); } localPythonFiles = getFileListing(); createPythonInterpreter(); attachPythonConsole(); }</code><technical_language>I this is a url anymore.. rename local variable filename ..</technical_language>

Target:
public Python(String n) { super(n); subscribe(Runtime.getInstance().getName(), "registered"); log.info("created python {}", getName()); log.info("creating module directory pythonModules"); new File("pythonModules").mkdir(); ServiceData sd = ServiceData.getLocalInstance(); Platform p = Platform.getLocalInstance(); List<ServiceType> sdt = sd.getAvailableServiceTypes(); for (int i = 0; i < sdt.size(); ++i) { ServiceType st = sdt.get(i); String file = String.format("%s/%s.py", st.getSimpleName(), st.getSimpleName()); exampleFiles.put(st.getSimpleName(), file); } localPythonFiles = getFileListing(); createPythonInterpreter(); attachPythonConsole(); }
Source:
<code>public byte[] serialize(Object object) { ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; try { try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(object); return baos.toByteArray(); } finally { if (oos != null) { oos.close(); } } } catch (Exception e) { throw new CacheException(e); <START> } <END> }</code><technical_language>exception thrown close() ignored. written in Java <= 6. java try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(object); return baos.toByteArray(); } catch (Exception e) { throw new CacheException(e); } finally { if (oos != null) { try { oos.close(); } catch (IOException e) { // } } }</technical_language>

Target:
public byte[] serialize(Object object) { ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(object); return baos.toByteArray(); } catch (Exception e) { throw new CacheException(e); } finally { if (oos != null) { try { oos.close(); } catch (IOException e) { } } } }
Source:
<code>protected FormRenderingSettings getKieServerFormDisplayProcess(String serverTemplateId, String domainId, String processId, boolean isDynamic) { try { Map<String, Object> valuesMap = new HashMap<String, Object>(); valuesMap.put(RestURI.CONTAINER_ID, domainId); valuesMap.put(RestURI.PROCESS_ID, processId); <START> valuesMap.put(RestURI.CASE_DEF_ID, processId); <END> String url = "jbpm/forms?containerId=" + domainId + "&serverTemplateId=" + serverTemplateId; if (isDynamic) { url += "&caseDefId=" + processId; } else { url += "&processId=" + processId; } return new KieServerFormRenderingSettings(url); } catch (KieServicesException e) { logger.debug("Unable to find process form in remote server due to {}", e.getMessage()); } catch (Exception e) { logger.debug("Unable to render process form due to {}", e.getMessage()); } return null; }</code><technical_language>I this anywhere</technical_language>

Target:
protected FormRenderingSettings getKieServerFormDisplayProcess(String serverTemplateId, String domainId, String processId, boolean isDynamic) { try { String url = "jbpm/forms?containerId=" + domainId + "&serverTemplateId=" + serverTemplateId; if (isDynamic) { url += "&caseDefId=" + processId; } else { url += "&processId=" + processId; } return new KieServerFormRenderingSettings(url); } catch (KieServicesException e) { logger.debug("Unable to find process form in remote server due to {}", e.getMessage()); } catch (Exception e) { logger.debug("Unable to render process form due to {}", e.getMessage()); } return null; }
Source:
<code>private void sendRelationshipErrorMessage( final String relationName, final User user ) { <START> SystemMessageEventUtil systemMessageEventUtil = SystemMessageEventUtil.getInstance(); <END> try { systemMessageEventUtil.pushMessage( new SystemMessageBuilder() .setMessage(LanguageUtil.format( user.getLocale(), "contenttypes.field.properties.relationship.required.error", relationName) ) .setSeverity(MessageSeverity.INFO) .setType(MessageType.SIMPLE_MESSAGE) .create(), list(user.getUserId()) ); } catch (LanguageException e) { throw new DotRuntimeException(e); } }</code><technical_language>set final</technical_language>

Target:
private void sendRelationshipErrorMessage( final String relationName, final User user ) { final SystemMessageEventUtil systemMessageEventUtil = SystemMessageEventUtil.getInstance(); try { systemMessageEventUtil.pushMessage( new SystemMessageBuilder() .setMessage(LanguageUtil.format( user.getLocale(), "contenttypes.field.properties.relationship.required.error", relationName) ) .setSeverity(MessageSeverity.INFO) .setType(MessageType.SIMPLE_MESSAGE) .create(), list(user.getUserId()) ); } catch (LanguageException e) { throw new DotRuntimeException(e); } }
Source:
<code>public static boolean isLoggedIn() { if (currentUserSession == null) { <START> LiferayLogger.e("You need to be logged to view the content!"); <END> return false; } return true; }</code><technical_language>showing error in console? This method checks a session, error a session</technical_language>

Target:
public static boolean isLoggedIn() { return currentUserSession != null; }
Source:
<code>public static String getCssValueFromTheme(Display display, String value) { BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext(); try { Object reference = MethodUtils.invokeMethod(context, "getServiceReference", "org.eclipse.e4.ui.css.swt.theme.IThemeManager"); if (reference != null) { Object iThemeManager = MethodUtils.invokeMethod(context, "getService", reference); if (iThemeManager != null) { final Object themeEngine = MethodUtils.invokeMethod(iThemeManager, "getEngineForDisplay", display); if (themeEngine != null) { Shell shell = display.getActiveShell(); if (shell == null) { for (Shell input : display.getShells()) { Object shellStyle = MethodUtils.invokeMethod(themeEngine, "getStyle", input); if (shellStyle instanceof CSSStyleDeclaration) { <START> shell = input; <END> break; } } } if (shell != null) { Object shellStyle = MethodUtils.invokeMethod(themeEngine, "getStyle", shell); if (shellStyle instanceof CSSStyleDeclaration) { CSSValue cssValue = ((CSSStyleDeclaration) shellStyle).getPropertyCSSValue(value); if (cssValue != null) { return cssValue.getCssText(); } } } } } } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { logOnce(e); return null; } return null; }</code><technical_language>style, instead of twice? creating a method CSSStyleDeclaration getShellStyle(Display)</technical_language>

Target:
public static String getCssValueFromTheme(Display display, String value) { BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext(); try { Object reference = MethodUtils.invokeMethod(context, "getServiceReference", "org.eclipse.e4.ui.css.swt.theme.IThemeManager"); if (reference != null) { Object iThemeManager = MethodUtils.invokeMethod(context, "getService", reference); if (iThemeManager != null) { Object themeEngine = MethodUtils.invokeMethod(iThemeManager, "getEngineForDisplay", display); if (themeEngine != null) { Shell shell = display.getActiveShell(); CSSStyleDeclaration shellStyle = null; if (shell != null) { shellStyle = getStyleDeclaration(themeEngine, shell); } else { for (Shell input : display.getShells()) { shellStyle = getStyleDeclaration(themeEngine, input); if (shellStyle != null) { break; } } } if (shellStyle != null) { CSSValue cssValue = shellStyle.getPropertyCSSValue(value); if (cssValue != null) { return cssValue.getCssText(); } } } } } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { logOnce(e); return null; } return null; }
Source:
<code>private FlinkUserCodeClassLoader ensureInner() { if (inner == null) { throw new IllegalStateException("Trying to access closed classloader. Please check if you store " + "classloaders directly or indirectly in static fields. If the stacktrace suggests that the leak " + "occurs in a third party library and cannot be fixed immediately, you can disable this check " + <START> "with the configuration 'classloader.check_leaked_classloader'."); <END> } return inner; }</code><technical_language>Retrieve key actual configuration object instead</technical_language>

Target:
private FlinkUserCodeClassLoader ensureInner() { if (inner == null) { throw new IllegalStateException("Trying to access closed classloader. Please check if you store " + "classloaders directly or indirectly in static fields. If the stacktrace suggests that the leak " + "occurs in a third party library and cannot be fixed immediately, you can disable this check " + "with the configuration '" + CoreOptions.CHECK_LEAKED_CLASSLOADER.key() + "'."); } return inner; }
Source:
<code>public boolean isProtected(ProtectionType type) { int armorCount = 0; boolean first = true; NamespacedKey setId = null; for (HashedArmorpiece armor : armor) { Optional<SlimefunArmorPiece> armorPiece = armor.getItem(); if (!armorPiece.isPresent()) return false; if (armorPiece.get() instanceof CustomProtection) { CustomProtection protectedArmor = (CustomProtection) armorPiece.get(); if (first) { <START> if (protectedArmor.isFullSetRequired()) setId = armorPiece.get().getSetId(); <END> first = false; } for (ProtectionType protectionType : protectedArmor.getProtectionTypes()) { if (protectionType == type) { if (setId == null) { return true; } else if (setId.equals(armorPiece.get().getSetId())) { armorCount++; } } } } } return armorCount == 4; }</code><technical_language>a variable for armour, it. Also, if gonna do a line if, generally for a short return. This is bad</technical_language>

Target:
public boolean isProtected(ProtectionType type) { int armorCount = 0; NamespacedKey setId = null; for (HashedArmorpiece armor : armor) { Optional<SlimefunArmorPiece> armorPiece = armor.getItem(); if (!armorPiece.isPresent()) return false; if (armorPiece.get() instanceof CustomProtection) { CustomProtection protectedArmor = (CustomProtection) armorPiece.get(); if (setId == null && protectedArmor.isFullSetRequired()) { setId = protectedArmor.getSetId(); } for (ProtectionType protectionType : protectedArmor.getProtectionTypes()) { if (protectionType == type) { if (setId == null) { return true; } else if (setId.equals(protectedArmor.getSetId())) { armorCount++; } } } } } return armorCount == 4; }
Source:
<code>public void updateParticipant(String identifier, ChatRoomMember chatRoomMember) { <START> if(this.participants.containsKey(identifier)) <END> { this.participants.get(identifier).setChatMember(chatRoomMember); } else { logger.warn("Asked to set chatroom member of participant with " + "identifier " + identifier + "while it wasn't added before"); } }</code><technical_language>NPE</technical_language>

Target:
public void updateParticipant(String identifier, ChatRoomMember chatRoomMember) { maybeAddParticipant(identifier); Participant participant = getParticipant(identifier); if (participant != null) { participant.setChatMember(chatRoomMember); } else { logger.warn("Asked to set chatroom member of participant with "+ "identifier "+ identifier+ "while it wasn't added before"); } }
Source:
<code>public static boolean isEncrypted(String blobIdString) { <START> if (blobIdString == null) { <END> return false; } DataInputStream stream = new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(Base64.decodeBase64(blobIdString)))); boolean isEncrypted = false; try { short version = stream.readShort(); if (version >= BLOB_ID_V3) { isEncrypted = (stream.readByte() & IS_ENCRYPTED_MASK) != 0; } } catch (IOException e) { isEncrypted = false; } finally { return isEncrypted; } }</code><technical_language>drop this check. If a caller calls a null argument, is error somewhere, this result in NPE</technical_language>

Target:
public static boolean isEncrypted(String blobIdString) throws IOException { DataInputStream stream = new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(Base64.decodeBase64(blobIdString)))); return (stream.readShort() >= BLOB_ID_V3) && ((stream.readByte() & IS_ENCRYPTED_MASK) != 0); }
Source:
<code><START> protected String createFuzzerName(HttpMessage message) { <END> String uri = message.getRequestHeader().getURI().toString(); if (uri.length() > 30) { uri = uri.substring(0, 14) + ".." + uri.substring(uri.length() - 15, uri.length()); } return Constant.messages.getString("fuzz.httpfuzzer.fuzzerNamePrefix", uri); }</code><technical_language>fine default name, if show a custom allow showing dialogue</technical_language>

Target:
private String createFuzzerName(HttpMessage message) { String uri = message.getRequestHeader().getURI().toString(); if (uri.length() > 30) { uri = uri.substring(0, 14) + ".." + uri.substring(uri.length() - 15, uri.length()); } return Constant.messages.getString("fuzz.httpfuzzer.fuzzerNamePrefix", uri); }
Source:
<code>private void updateWithResources(List<IProject> newValue) { Map<IProject, ProjectWrapper> updated = new HashMap<>(); boolean changed = false; synchronized (projects) { HashMap<IProject, ProjectWrapper> oldWrappers = new HashMap<>(projects); projects.clear(); for (IProject r : newValue) { ProjectWrapper existingWrapper = oldWrappers.remove(r); if (existingWrapper == null) { ProjectWrapper newWrapper = new ProjectWrapper(this, r); <START> resourceCache.add(r); <END> WatchManager.getInstance().startWatch(newWrapper.getWrapped(), newWrapper.getParent().getWrapped(), ResourceKind.PROJECT); projects.put(r, newWrapper); changed = true; } else { projects.put(r, existingWrapper); updated.put(r, existingWrapper); } } if (!oldWrappers.isEmpty()) { changed = true; } } updated.keySet().forEach(r -> { ProjectWrapper wrapper = updated.get(r); wrapper.updateWith(r); }); if (changed) { fireChanged(); } }</code><technical_language>This wrong place watch. thought is start watch connection expansion, this is place insert it. Also, I expect need provide project name for a watch; watches provide callbacks based resource kind receive callbacks for resource of kind for access</technical_language>

Target:
private void updateWithResources(List<IProject> newValue) { Map<IProject, ProjectWrapper> updated = new HashMap<>(); boolean changed = false; synchronized (projects) { HashMap<String, ProjectWrapper> oldWrappers = new HashMap<>(projects); projects.clear(); for (IProject r : newValue) { ProjectWrapper existingWrapper = oldWrappers.remove(r.getName()); if (existingWrapper == null) { ProjectWrapper newWrapper = new ProjectWrapper(this, r); resourceCache.add(r); WatchManager.getInstance().startWatch(newWrapper.getWrapped(), newWrapper.getParent().getWrapped(), ResourceKind.PROJECT); projects.put(r.getName(), newWrapper); changed = true; } else { projects.put(r.getName(), existingWrapper); updated.put(r, existingWrapper); } } if (!oldWrappers.isEmpty()) { changed = true; } } updated.keySet().forEach(r -> { ProjectWrapper wrapper = updated.get(r); wrapper.updateWith(r); }); if (changed) { fireChanged(); } }
Source:
<code>public DirCache call() throws NoFilepatternException { Git git = new Git(getRepository()); File srcFile = new File(getRepository().getWorkTree(), source); File dstFile = new File(getRepository().getWorkTree(), destination); srcFile.renameTo(dstFile); git.add().addFilepattern(destination).call(); <START> return git.rm().addFilepattern(source).call(); <END> }</code><technical_language>Behavior is C Git here. If a flle affected source tracked in index C Git fals. Mv'ing a directory tracked files fails in C Git. mv a directory some untracked files directory renamed. -f -k options important handle here</technical_language>

Target:
public DirCache call() throws GitAPIException { if (source == null || destination == null) throw new NoFilepatternException( JGitText.get().sourceDestinationMustBeProvided); try { Git git = new Git(getRepository()); File srcFile = new File(getRepository().getWorkTree(), source); if (!isTracked(srcFile)) { throw new MoveException( JGitText.get().sourceIsNotUnderVersionControl); } File dstFile = new File(getRepository().getWorkTree(), destination); srcFile.renameTo(dstFile); git.add().addFilepattern(destination).call(); return git.rm().addFilepattern(source).call(); } catch (IOException e) { throw new JGitInternalException( MessageFormat.format( JGitText.get().exceptionCaughtDuringExecutionOfMvCommand, e), e); } }
Source:
<code>public List<Relationship> getLeftRelations(Context context, Entity entity) { List<Relationship> fullList = this.getAllRelations(context, entity); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { <START> if (relationship.getLeftItem() == entity.getItem()) { <END> listToReturn.add(relationship); } } return listToReturn; }</code><technical_language>equals here</technical_language>

Target:
public List<Relationship> getLeftRelations(Context context, Entity entity) { List<Relationship> fullList = entity.getRelationships(); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { if (relationship.getLeftItem().getID() == entity.getItem().getID()) { listToReturn.add(relationship); } } return listToReturn; }
Source:
<code>public boolean hasCompatibleMimeType(List<String> mimeTypes, String mimeType) { String mt = parseMimeType(mimeType); Set<String> expectedMimeTypes = new HashSet<>(); expectedMimeTypes.add(ANY_MIME_TYPE); <START> if (mimeType != null) { <END> expectedMimeTypes.add(mt); expectedMimeTypes.add(computeMimeTypeWithWildcardSubType(mt)); } return mimeTypes.stream().anyMatch(expectedMimeTypes::contains); }</code><technical_language>mt != null for consistency</technical_language>

Target:
public boolean hasCompatibleMimeType(List<String> mimeTypes, String mimeType) { String mt = parseMimeType(mimeType); Set<String> expectedMimeTypes = new HashSet<>(); expectedMimeTypes.add(ANY_MIME_TYPE); if (mt != null) { expectedMimeTypes.add(mt); expectedMimeTypes.add(computeMimeTypeWithWildcardSubType(mt)); } return mimeTypes.stream().anyMatch(expectedMimeTypes::contains); }
Source:
<code>public Boolean isLocal() { <START> Boolean isLocal = this.pluginConfig.getSimple(Property.LOCAL).getBooleanValue(); <END> if (isLocal == null) { return Boolean.FALSE; } return isLocal; }</code><technical_language>This NPE. this.pluginConfig.getSimple(Property.LOCAL) is equal null defaultValue if property is found</technical_language>

Target:
public Boolean isLocal() { return Boolean.valueOf(this.pluginConfig.getSimpleValue(Property.LOCAL, "false")); }
Source:
<code><START> private List<Grant> testPushInternal(boolean disableAcl, String ownerId, String ownerDisplayName) throws Exception <END> { ServerSideEncryptingAmazonS3 s3Client = EasyMock.createMock(ServerSideEncryptingAmazonS3.class); EasyMock.expect(s3Client.putObject(EasyMock.anyObject())) .andReturn(new PutObjectResult()) .once(); AccessControlList aclExpected = new AccessControlList(); aclExpected.setOwner(new Owner("test_owner", "test_owner")); EasyMock.expect(s3Client.getBucketAcl("test_bucket")) .andReturn(aclExpected) .once(); EasyMock.expect(s3Client.putObject(EasyMock.anyObject(PutObjectRequest.class))) .andReturn(new PutObjectResult()) .once(); EasyMock.replay(s3Client); S3TaskLogsConfig config = new S3TaskLogsConfig(); config.setDisableAcl(disableAcl); config.setS3Bucket("test_bucket"); S3TaskLogs s3TaskLogs = new S3TaskLogs(s3Client, config); String taskId = "index_test-datasource_2019-06-18T13:30:28.887Z"; File logFile = tempFolder.newFile("test_log_file"); s3TaskLogs.pushTaskLog(taskId, logFile); List<Grant> grantsAsList = aclExpected.getGrantsAsList(); return grantsAsList; }</code><technical_language>ownerId ownerDisplayName</technical_language>

Target:
private List<Grant> testPushInternal(boolean disableAcl, String ownerId, String ownerDisplayName) throws Exception { ServerSideEncryptingAmazonS3 s3Client = EasyMock.createMock(ServerSideEncryptingAmazonS3.class); EasyMock.expect(s3Client.putObject(EasyMock.anyObject())) .andReturn(new PutObjectResult()) .once(); AccessControlList aclExpected = new AccessControlList(); aclExpected.setOwner(new Owner(ownerId, ownerDisplayName)); EasyMock.expect(s3Client.getBucketAcl("test_bucket")) .andReturn(aclExpected) .once(); EasyMock.expect(s3Client.putObject(EasyMock.anyObject(PutObjectRequest.class))) .andReturn(new PutObjectResult()) .once(); EasyMock.replay(s3Client); S3TaskLogsConfig config = new S3TaskLogsConfig(); config.setDisableAcl(disableAcl); config.setS3Bucket("test_bucket"); S3TaskLogs s3TaskLogs = new S3TaskLogs(s3Client, config); String taskId = "index_test-datasource_2019-06-18T13:30:28.887Z"; File logFile = tempFolder.newFile("test_log_file"); s3TaskLogs.pushTaskLog(taskId, logFile); List<Grant> grantsAsList = aclExpected.getGrantsAsList(); return grantsAsList; }
Source:
<code>private Shell getShell(FileModificationValidationContext context) { if (context.getShell() != null) return (Shell)context.getShell(); IWorkbench workbench = getWorkbench(); if <START> (workbench != null) { <END> IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); if (window != null) { return window.getShell(); } } return null; }</code><technical_language>This happen, if, NPE happen too. please remove</technical_language>

Target:
private Shell getShell(FileModificationValidationContext context) { if (context.getShell() != null) return (Shell)context.getShell(); IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); if (window != null) { return window.getShell(); } return null; }
Source:
<code>boolean addReplicaInfoIfAbsent(RemoteReplicaInfo remoteReplicaInfo) { <START> lock.lock(); <END> boolean isAdded = false; try { List<RemoteReplicaInfo> foundSameReplica = remoteReplicas.stream() .filter(info -> info.getReplicaId() == remoteReplicaInfo.getReplicaId()) .collect(Collectors.toList()); if (foundSameReplica.isEmpty()) { remoteReplicas.add(remoteReplicaInfo); isAdded = true; } } finally { lock.unlock(); } return isAdded; }</code><technical_language>please lock getRemoveReplicaInfos method well, this lock is protecting remoteReplicas list, lock it</technical_language>

Target:
boolean addReplicaInfoIfAbsent(RemoteReplicaInfo remoteReplicaInfo) { rwLock.writeLock().lock(); boolean isAdded = false; try { List<RemoteReplicaInfo> foundSameReplica = remoteReplicas.stream() .filter(info -> info.getReplicaId() == remoteReplicaInfo.getReplicaId()) .collect(Collectors.toList()); if (foundSameReplica.isEmpty()) { remoteReplicas.add(remoteReplicaInfo); isAdded = true; } } finally { rwLock.writeLock().unlock(); } return isAdded; }
Source:
<code>public void testGetSingleInvalidTable() throws Exception { <START> queryStore.get(UUID.randomUUID().toString(), UUID.randomUUID().toString()); <END> }</code><technical_language>Check for equality of error code</technical_language>

Target:
public void testGetSingleInvalidTable() throws Exception { try { queryStore.get(UUID.randomUUID().toString(), UUID.randomUUID().toString()); } catch (QueryStoreException e) { assertEquals(QueryStoreException.ErrorCode.NO_SUCH_TABLE, e.getErrorCode()); throw e; } }
Source:
<code>public List<Class> getSupportedTypes() { <START> return new ArrayList<>(Arrays.asList(BigDecimal.class)); <END> }</code><technical_language>Collections.singletonList</technical_language>

Target:
public List<Class> getSupportedTypes() { return Collections.singletonList(BigDecimal.class); }
Source:
<code>private static ZoneOffset idToZoneOffset(ZoneId zoneId) { String id = zoneId.getValue(); <START> java.time.ZoneId javaZoneId = java.time.ZoneId.of(id); <END> int offsetInSeconds = ZonedDateTime.now(javaZoneId) .getOffset() .getTotalSeconds(); ZoneOffset offset = ZoneOffset .newBuilder() .setAmountSeconds(offsetInSeconds) .build(); return offset; }</code><technical_language>Please inline zoneId.getValue() call. id variable code more readable, "ID" is broad of a term</technical_language>

Target:
private static ZoneOffset idToZoneOffset(ZoneId zoneId) { java.time.ZoneId javaZoneId = java.time.ZoneId.of(zoneId.getValue()); int offsetInSeconds = ZonedDateTime.now(javaZoneId) .getOffset() .getTotalSeconds(); ZoneOffset offset = ZoneOffset .newBuilder() .setAmountSeconds(offsetInSeconds) .build(); return offset; }
Source:
<code>public boolean removeQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); return removeQueueNames(Arrays.stream(queues) .map(q -> q.getName()) .collect(Collectors.toList()) <START> .toArray(new String[0])); <END> }</code><technical_language>toArray(String[]::new) instead of operators</technical_language>

Target:
public boolean removeQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); return removeQueueNames(Arrays.stream(queues) .map(q -> q.getActualName()) .toArray(String[]::new)); }
Source:
<code>public boolean hasAggregateOrGroupby() { <START> return hasAggregateExpression() || isGrouped(); <END> }</code><technical_language>Adds cost ambiguity for practical benefit</technical_language>

Target:
public boolean hasAggregateOrGroupby() { return m_hasAggregateExpression || isGrouped(); }
Source:
<code>public void testEBPointToPointWithReply() { EventBus eb = Vertx.vertx().eventBus(); MessageConsumer<String> mc = eb.consumer("news.uk.sport"); mc.handler(message -> { System.out.println("I have received a message: " + message.body()); message.reply("Thanks for the message"); }); mc.completionHandler(res -> { if (res.succeeded()) { System.out.println("The handler registration has reached all nodes"); eb.send("news.uk.sport", "Yay! Someone kicked a ball", new Handler<AsyncResult<Message<String>>>() { @Override public void handle(AsyncResult<Message<String>> message) { System.out.println("Received reply: " + message.result().body()); } }); } else { System.out.println("Registration failed!"); } }); <START> mc.unregister(); <END> checkBTxnFragments(); }</code><technical_language>run build yet, work fine - wondering if consumer is unregistered completion handler fires (async), message bus. I is I introduce delays. some synchronization performed, wait message reply received</technical_language>

Target:
public void testEBPointToPointWithReply() throws InterruptedException { EventBus eb = Vertx.vertx().eventBus(); CountDownLatch latch = new CountDownLatch(1); MessageConsumer<String> mc = eb.consumer("news.uk.sport"); mc.handler(message -> { System.out.println("I have received a message: " + message.body()); message.reply("Thanks for the message"); }); mc.completionHandler(res -> { if (res.succeeded()) { System.out.println("The handler registration has reached all nodes"); eb.send("news.uk.sport", "Yay! Someone kicked a ball", new Handler<AsyncResult<Message<String>>>() { @Override public void handle(AsyncResult<Message<String>> message) { System.out.println("Received reply: " + message.result().body()); latch.countDown(); } }); } else { System.out.println("Registration failed!"); } }); latch.await(2, TimeUnit.SECONDS); mc.unregister(); checkBTxnFragments(); }
Source:
<code>public void threadStressTest() { Realm realm = Realm.getInstance(realmConfig); populateTestRealm(realm); <START> for (int i = 0; i < MAX_THREADS; i++) { <END> CRUDAction action = CRUDAction.fromValue(random.nextInt(4)); ThreadWrapper thread = null; switch(action) { case CREATE: thread = createObjects(random.nextInt(MAX_CREATE), random.nextBoolean()); break; case READ: thread = readObjects(random.nextBoolean()); break; case UPDATE: thread = updateObjects(random.nextBoolean(), random.nextBoolean()); break; case DELETE: thread = deleteObjects(random.nextBoolean(), random.nextBoolean()); break; } threads.add(thread); thread.start(); } for (ThreadWrapper thread : threads) { thread.join(); } realm.close(); }</code><technical_language>This spawn MAX_THREADS number of Thread, a variant of this test suing a ThreadPool test re-usage of a Thread Realm useful</technical_language>

Target:
public void threadStressTest() throws ExecutionException, InterruptedException { Realm realm = Realm.getInstance(realmConfig); populateTestRealm(realm); for (int i = 0; i < MAX_THREADS; i++) { CRUDAction action = CRUDAction.values()[random.nextInt(4)]; Runnable task = null; switch(action) { case CREATE: task = createObjects(random.nextInt(MAX_CREATE), random.nextBoolean()); break; case READ: task = readObjects(random.nextBoolean()); break; case UPDATE: task = updateObjects(random.nextBoolean(), random.nextBoolean()); break; case DELETE: task = deleteObjects(random.nextBoolean(), random.nextBoolean()); break; } threads.add(executor.submit(task)); } for (Future task : threads) { assertNull(task.get()); } realm.close(); }
Source:
<code>public void addMany(MetaParam... metaParams) { if (metas.length == 0) { if (metaParams.getClass().getComponentType() == MetaParam.class) { metas = metaParams; } else { metas = Arrays.copyOf(metaParams, metaParams.length, MetaParam[].class); } length = (int) Stream.of(metas).filter(Objects::nonNull).count(); } else { List<MetaParam<?>> notFound = new ArrayList<>(metaParams.length); for (MetaParam newMeta : metaParams) { int hole = -1; boolean found = false; for (int i = 0; i < metas.length; i++) { MetaParam<?> m = metas[i]; if (m == null) { hole = i; } else if (m.getClass().isAssignableFrom(newMeta.getClass())) { metas[i] = newMeta; found = true; break; <START> } <END> } if (!found) { ++length; if (hole < 0) { notFound.add(newMeta); } else { metas[hole] = newMeta; } } } if (!notFound.isEmpty()) { MetaParam<?>[] newMetas = Arrays.copyOf(metas, metas.length + notFound.size()); int i = metas.length; for (MetaParam<?> meta : notFound) { newMetas[i++] = meta; } } } assert checkLength(); }</code><technical_language>metas = newMetas missing</technical_language>

Target:
public void addMany(MetaParam... metaParams) { if (metas.length == 0) { if (metaParams.getClass().getComponentType() == MetaParam.class) { metas = metaParams; } else { metas = Arrays.copyOf(metaParams, metaParams.length, MetaParam[].class); } length = (int) Stream.of(metas).filter(Objects::nonNull).count(); } else { List<MetaParam<?>> notFound = new ArrayList<>(metaParams.length); for (MetaParam newMeta : metaParams) { updateExisting(newMeta, notFound); } if (!notFound.isEmpty()) { MetaParam<?>[] newMetas = Arrays.copyOf(metas, metas.length + notFound.size()); int i = metas.length; for (MetaParam<?> meta : notFound) { newMetas[i++] = meta; } metas = newMetas; } } assert checkLength(); }
Source:
<code>protected Builder makeUserRequestBuilder(UserInfo info) { Builder builder = new Request.Builder(); if (info != null) { <START> if (this.constructorToken != null) { <END> builder.addHeader("x-cnstrc-token", this.constructorToken); } if (info.getForwardedFor() != null) { builder.addHeader("x-forwarded-for", info.getForwardedFor()); } } return builder; }</code><technical_language>this code x-cnstrc-token set if info is null. Is this intentional</technical_language>

Target:
protected Builder makeUserRequestBuilder(UserInfo info) { Builder builder = new Request.Builder(); if (this.constructorToken != null) { builder.addHeader("x-cnstrc-token", this.constructorToken); } if (info != null && info.getForwardedFor() != null) { builder.addHeader("x-forwarded-for", info.getForwardedFor()); } return builder; }
Source:
<code>public static Properties defaultProperties() { Properties properties = new Properties(); <START> properties.setProperty(TEMPLATE, "osFamily=UBUNTU,loginUser=jclouds"); <END> return properties; }</code><technical_language>duplicate property here. is enough in ApiMetadata</technical_language>

Target:
public static Properties defaultProperties() { Properties properties = AzureManagementApiMetadata.defaultProperties(); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,loginUser=jclouds"); properties.setProperty(OPERATION_TIMEOUT, "" + 60 * 1000); properties.setProperty(OPERATION_POLL_INITIAL_PERIOD, "" + 5); properties.setProperty(OPERATION_POLL_MAX_PERIOD, "" + 15); properties.setProperty(AzureComputeProperties.TCP_RULE_FORMAT, "tcp_%s-%s"); return properties; }
Source:
<code>private static List<Tree> getMutations(Parameter parameter) { Expression defaultValue = parameter.defaultValue(); if (defaultValue == null) { return Collections.emptyList(); } Optional<Symbol> paramSymbol = getSymbolFromTree(parameter.name()); if (!paramSymbol.isPresent() || isUsingMemoization(paramSymbol.get())) { return Collections.emptyList(); } if (!defaultValue.type().canOnlyBe(BuiltinTypes.NONE_TYPE)) { List<Tree> attributeSet = getAttributeSet(paramSymbol.get()); if (!attributeSet.isEmpty()) { return attributeSet; } } String defaultValueType = defaultValueType(defaultValue); <START> Set<String> typeMutatingMethods = MUTATING_METHODS.get(defaultValueType); if (typeMutatingMethods == null) { return Collections.emptyList(); } return paramSymbol.get().usages().stream().filter(usage -> { Tree parent = usage.tree().parent(); if (parent.is(QUALIFIED_EXPR)) { QualifiedExpression qualifiedExpression = (QualifiedExpression) parent; return getSymbolFromTree(qualifiedExpression.qualifier()).equals(paramSymbol) && isMutatingMethod(typeMutatingMethods, qualifiedExpression.name().name()); } return isUsedInDelStatement(usage.tree()) || <END> isUsedInLhsOfAssignment(usage.tree(), exp -> isAccessingExpression(exp, usage.tree())) || isUsedInLhsOfCompoundAssignment(usage.tree()) || isGetItemOnDefaultDict(defaultValueType, usage.tree()) || mightBeReferencedOutsideOfFunction(usage.tree()); }).map(usage -> usage.tree().parent()).collect(Collectors.toList()); }</code><technical_language>I find this block of code hard read due returns tight formatting. I a bit more spacious, I introduce some blank lines control structures</technical_language>

Target:
private static List<Tree> getMutations(Parameter parameter) { Expression defaultValue = parameter.defaultValue(); if (defaultValue == null) { return Collections.emptyList(); } Optional<Symbol> paramSymbol = getSymbolFromTree(parameter.name()); if (!paramSymbol.isPresent() || isUsingMemoization(paramSymbol.get())) { return Collections.emptyList(); } if (!defaultValue.type().canOnlyBe(BuiltinTypes.NONE_TYPE)) { List<Tree> attributeSet = getAttributeSet(paramSymbol.get()); if (!attributeSet.isEmpty()) { return attributeSet; } } String defaultValueType = defaultValueType(defaultValue); Set<String> typeMutatingMethods = MUTATING_METHODS.get(defaultValueType); if (typeMutatingMethods == null) { return Collections.emptyList(); } return paramSymbol.get().usages().stream() .filter(usage -> isWriteUsage(paramSymbol, defaultValueType, typeMutatingMethods, usage)) .map(usage -> usage.tree().parent()) .collect(Collectors.toList()); }
Source:
<code>public AbstractDiskVmCommand(T parameters) { super(parameters); if (parameters.getDiskInfo() != null && DiskStorageType.IMAGE == parameters.getDiskInfo().getDiskStorageType()) { setQuotaId(((DiskImage) parameters.getDiskInfo()).getQuotaId()); <START> } <END> if (getVm() != null) { setStoragePoolId(getVm().getstorage_pool_id()); } }</code><technical_language>I idea put query constarctor, of AddDiskCommand do unneeded query, need a poolId for DetachDiskFromVmCommand for UpdateVmDiskCommand, HotPlug UnPlug, putting constractor is wrong</technical_language>

Target:
public AbstractDiskVmCommand(T parameters) { super(parameters); if (parameters.getDiskInfo() != null && DiskStorageType.IMAGE == parameters.getDiskInfo().getDiskStorageType()) { setQuotaId(((DiskImage) parameters.getDiskInfo()).getQuotaId()); } }
Source:
<code>public boolean begin() { if ( getStatus() == TransactionManager.STATUS_ROLLEDBACK ) { logger.info("Cleanup of transaction that has been rolled back previously"); <START> rollback(true); <END> } if ( getStatus() == TransactionManager.STATUS_NO_TRANSACTION ) { try { getUt().begin(); return true; } catch ( Exception e ) { if (e.getClass().getName().equals("javax.ejb.EJBException")) { this.ut = findUserTransaction(); this.tm = findTransactionManager(this.ut); this.tsr = findTransactionSynchronizationRegistry(this.ut, this.tm); try { this.ut.begin(); return true; } catch (Exception ex) { logger.warn( "Unable to begin transaction", e); throw new RuntimeException( "Unable to begin transaction", e ); } } else { logger.warn( "Unable to begin transaction", e); throw new RuntimeException( "Unable to begin transaction", e ); } } } return false; }</code><technical_language>@martinweiler refactor this call getStatus in majority of cases refresh rollback here? eliminate of duplicated calls getStatus for transaction start</technical_language>

Target:
public boolean begin() { int status = getStatus(); if ( status == TransactionManager.STATUS_ROLLEDBACK ) { logger.debug("Cleanup of transaction that has been rolled back previously"); rollback(true); status = getStatus(); } if ( status == TransactionManager.STATUS_NO_TRANSACTION ) { try { getUt().begin(); return true; } catch ( Exception e ) { if (e.getClass().getName().equals("javax.ejb.EJBException")) { this.ut = findUserTransaction(); this.tm = findTransactionManager(this.ut); this.tsr = findTransactionSynchronizationRegistry(this.ut, this.tm); try { this.ut.begin(); return true; } catch (Exception ex) { logger.warn( "Unable to begin transaction", e); throw new RuntimeException( "Unable to begin transaction", e ); } } else { logger.warn( "Unable to begin transaction", e); throw new RuntimeException( "Unable to begin transaction", e ); } } } return false; }
Source:
<code>public void load(final InputStream imagePayload) throws DockerException, InterruptedException { <START> load(imagePayload, new LoggingSaveHandler()); <END> }</code><technical_language>call LoggingLoadHandler? Is save more accurate here</technical_language>

Target:
public Set<String> load(final InputStream imagePayload) throws DockerException, InterruptedException { return load(imagePayload, new LoggingLoadHandler()); }
Source:
<code>Metrics.MetricFamily.Builder annotateBuilder(final Metrics.MetricFamily.Builder b) { try { skipChild: for (final Map<String, String> labels : children.keySet()) { final Child child = children.get(labels); if (child.isEmpty()) { continue; } final Metrics.Summary.Builder builder = Metrics.Summary.newBuilder(); for (final double q : child.targets.keySet()) { final Double v = child.query(q); if (v == null) { continue skipChild; } final Metrics.Quantile.Builder qs = builder.addQuantileBuilder(); qs.setQuantile(q); qs.setValue(v); } <START> builder.setSampleCount(child.count.get()); <END> builder.setSampleSum(child.sum.get()); final Metrics.Metric.Builder m = b.addMetricBuilder(); for (final String label : labels.keySet()) { final String value = labels.get(label); m.addLabelBuilder().setName(label).setValue(value); } m.setSummary(builder.build()); } return b; } finally { purge(); } }</code><technical_language>question this: currently, histogram is reset, _count metric is reset too. People thought get a counter metric for free a histogram, if reset couple of minutes more frequently, unreliable useful for rate calculations. get reset scrapes if a high scrape interval purge interval, completely useless. So: people depend this metric for useful, change in a reset</technical_language>

Target:
Metrics.MetricFamily.Builder annotateBuilder(final Metrics.MetricFamily.Builder b) { try { for (final Map<String, String> labels : children.keySet()) { final Child child = children.get(labels); final Metrics.Summary.Builder builder = Metrics.Summary.newBuilder(); if (!child.isEmpty()) { for (final double q : child.targets.keySet()) { final Double v = child.query(q); if (v == null) { continue; } final Metrics.Quantile.Builder qs = builder.addQuantileBuilder(); qs.setQuantile(q); qs.setValue(v); } } builder.setSampleCount(child.count.get()); builder.setSampleSum(child.sum.get()); final Metrics.Metric.Builder m = b.addMetricBuilder(); for (final String label : labels.keySet()) { final String value = labels.get(label); m.addLabelBuilder().setName(label).setValue(value); } m.setSummary(builder); } return b; } finally { purge(); } }