auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void validatePlugins(WorkspaceConfig config) throws ValidationException { List<String> installers = config .getEnvironments() .values() .stream() .map( env -> env.getMachines() .values() .stream() .map(MachineConfig::getInstallers) .flatMap(List::stream)) .flatMap(Function.identity()) <START> .collect(Collectors.toList()); <END> Map<String, String> attributes = config.getAttributes(); boolean hasPlugins = !Strings.isNullOrEmpty(attributes.getOrDefault(PLUGINS_ATTRIBUTE, null)); boolean hasEditor = !Strings.isNullOrEmpty(attributes.getOrDefault(EDITOR_ATTRIBUTE, null)); if ((hasPlugins || hasEditor) && installers.size() > 0) { throw new ValidationException("Workspace config cannot have both plugins and installers."); } }</code><technical_language>I need collect items findAny enough</technical_language>

Target:
private void validatePlugins(WorkspaceConfig config) throws ValidationException { Optional<String> installers = config .getEnvironments() .values() .stream() .flatMap(env -> env.getMachines().values().stream()) .flatMap(machine -> machine.getInstallers().stream()) .findAny(); Map<String, String> attributes = config.getAttributes(); boolean hasPlugins = !Strings.isNullOrEmpty( attributes.getOrDefault(Constants.WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, null)); boolean hasEditor = !Strings.isNullOrEmpty( attributes.getOrDefault(Constants.WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, null)); if ((hasPlugins || hasEditor) && installers.isPresent()) { throw new ValidationException("Workspace config cannot have both plugins and installers."); } }
Source:
<code>private void validate() throws UnloggedFailure { if (active && inactive) { <START> throw new UnloggedFailure(1, "You can't use both --active and --inactive"); <END> } if (addSshKeys.contains("-")) { if (deleteSshKeys.contains("-")) { throw new UnloggedFailure(1, "You can't use both --add-ssh-key and --delete-ssh-key with stdin"); } if (addSshKeys.size() > 1) { throw new UnloggedFailure(1, "You can't use stdin with multiple arguments"); } } if (deleteSshKeys.size() > 1) { if (deleteSshKeys.contains("-")) { throw new UnloggedFailure(1, "You can't use stdin with multiple arguments"); } if (deleteSshKeys.contains("ALL")) { throw new UnloggedFailure(1, "You can't use 'ALL' with multiple arguments"); } } if (deleteEmails.size() > 1 && deleteEmails.contains("ALL")) { throw new UnloggedFailure(1, "You can't use 'ALL' with multiple arguments"); } }</code><technical_language>Suggestion: "--active --inactive options mutually exclusive."</technical_language>

Target:
private void validate() throws UnloggedFailure { if (active && inactive) { throw new UnloggedFailure(1, "--active and --inactive options are mutually exclusive."); } if (addSshKeys.contains("-") && deleteSshKeys.contains("-")) { throw new UnloggedFailure(1, "Only one option may use the stdin"); } if (deleteSshKeys.contains("ALL")) { deleteSshKeys = Collections.singletonList("ALL"); } if (deleteEmails.contains("ALL")) { deleteEmails = Collections.singletonList("ALL"); } }
Source:
<code>public MutableBoundedValue<Double> walkSpeed() { return SpongeValueBuilder.boundedBuilder(Keys.WALKING_SPEED) .defaultValue(0.699999988079071D) <START> .minimum(0D) <END> .maximum(Double.MAX_VALUE) .actualValue(this.walkSpeed) .build(); }</code><technical_language>minimum restricted in this case</technical_language>

Target:
public Value<Double> walkSpeed() { return new SpongeValue<>(Keys.WALKING_SPEED, 0.7D, this.walkSpeed); }
Source:
<code>public long getID() { <START> if (!isConnected()) { <END> throw new IllegalStateException("Session must be connected first."); } return mSessionID; }</code><technical_language>remove guard, simply return null (mSessionID set null session left a realm - of null transport is detached too)</technical_language>

Target:
public long getID() { return mSessionID; }
Source:
<code>public ASTNode visit(TermCons tc, Void _) { if (!MetaK.isComputationSort(tc.getSort())) { return KApp.of(new KInjectedLabel((Term) trans.visitNode(tc))); } String l = tc.getLocation(); String f = tc.getFilename(); Production ppp = tc.getProduction(); KList lok = new KList(l, f); for (Term t : tc.getContents()) { lok.getContents().add((Term) this.visitNode(t)); } String label; <START> if (ppp.isListDecl() && tc.getContents().size() == 0) <END> label = "'.List{\"" + StringUtil.escape(ppp.getListDecl().getSeparator()) + "\"}"; else label = ppp.getKLabel(); return new KApp(l, f, KLabelConstant.of(label, context), lok); }</code><technical_language>tc.isListTerminator()</technical_language>

Target:
public ASTNode visit(TermCons tc, Void _) { if (!MetaK.isComputationSort(tc.getSort())) { return KApp.of(new KInjectedLabel((Term) trans.visitNode(tc))); } String l = tc.getLocation(); String f = tc.getFilename(); Production ppp = tc.getProduction(); KList lok = new KList(l, f); for (Term t : tc.getContents()) { lok.getContents().add((Term) this.visitNode(t)); } String label; if (tc.isListTerminator()) label = tc.getProduction().getListDecl().getTerminatorKLabel(); else label = ppp.getKLabel(); return new KApp(l, f, KLabelConstant.of(label, context), lok); }
Source:
<code>private Rect calculateFocusArea(float x, float y) { Display display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); Point size = new Point(); display.getSize(size); <START> screen_width = size.x; <END> screen_height = size.y; int left = clamp(Float.valueOf((x / mSurfaceView.getWidth()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); int top = clamp(Float.valueOf((y / mSurfaceView.getHeight()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); return new Rect(left, top, left + FOCUS_AREA_SIZE, top + FOCUS_AREA_SIZE); }</code><technical_language>functions in Utils.java [Link](<LINK_0></technical_language>

Target:
private Rect calculateFocusArea(float x, float y) { screen_width = Utils.getScreenWidth(getContext()); screen_height = Utils.getScreenHeight(getContext()); int left = clamp(Float.valueOf((x / mSurfaceView.getWidth()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); int top = clamp(Float.valueOf((y / mSurfaceView.getHeight()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); return new Rect(left, top, left + FOCUS_AREA_SIZE, top + FOCUS_AREA_SIZE); }
Source:
<code>public CliCommand init(final Arguments args) throws Exception { this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The bulk put command requires '-b' to be set."); } pipe = args.isPipe(); if (pipe) { this.pipedFiles = getPipedFilesFromStdin(); if (this.pipedFiles.isEmpty()) { throw new MissingOptionException("Stdin is empty"); } } else { final String srcDir = args.getDirectory(); if (srcDir == null) { throw new MissingOptionException("The bulk put command required '-d' to be set."); } <START> this.inputDirectory = FileSystems.getDefault().getPath(srcDir); <END> } if (args.getObjectName() != null) { System.err.println("Warning: '-o' is not used with bulk put and is ignored."); } this.prefix = args.getPrefix(); this.priority = args.getPriority(); this.writeOptimization = args.getWriteOptimization(); this.checksum = args.isChecksum(); this.force = args.isForce(); if (args.isSync()) { LOG.info("Using sync command"); this.sync = true; } this.numberOfThreads = Integer.valueOf(args.getNumberOfThreads()); return this; }</code><technical_language>replace this Paths.get(srcDir)</technical_language>

Target:
public CliCommand init(final Arguments args) throws Exception { this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The bulk put command requires '-b' to be set."); } this.pipe = Utils.isPipe(); if (this.pipe) { if (this.isOtherArgs(args)) { throw new BadArgumentException("-d, -o and -p arguments are not supported when using piped input"); } this.pipedFiles = Utils.getPipedFilesFromStdin(getFileUtils()); if (Guard.isNullOrEmpty(this.pipedFiles)) { throw new MissingOptionException("Stdin is empty"); } this.mapNormalizedObjectNameToObjectName = this.getNormalizedObjectNameToObjectName(this.pipedFiles); } else { final String srcDir = args.getDirectory(); if (srcDir == null) { throw new MissingOptionException("The bulk put command required '-d' to be set."); } this.inputDirectory = Paths.get(srcDir); if (args.getObjectName() != null) { System.err.println("Warning: '-o' is not used with bulk put and is ignored."); } this.prefix = args.getPrefix(); } this.priority = args.getPriority(); this.writeOptimization = args.getWriteOptimization(); this.checksum = args.isChecksum(); this.force = args.isForce(); if (args.isSync()) { if (!SyncUtils.isSyncSupported(getClient())) { throw new SyncNotSupportedException("The sync command is not supported with your version of BlackPearl."); } LOG.info("Using sync command"); this.sync = true; } this.numberOfThreads = Integer.valueOf(args.getNumberOfThreads()); if (args.isIgnoreErrors()) { LOG.info("Ignoring files that cause errors"); this.ignoreErrors = true; } return this; }
Source:
<code>private XmlRpcStruct initNicStructure() { XmlRpcStruct map = new XmlRpcStruct(); VmNetworkInterface nic = getParameters().getNic(); VmDevice vmDevice = getParameters().getVmDevice(); map.add("type", "interface"); map.add("device", "bridge"); map.add("macAddr", nic.getMacAddress()); map.add("network", nic.getNetworkName()); addAddress(map, vmDevice.getAddress()); map.add("specParams", vmDevice.getSpecParams()); map.add("nicModel", VmInterfaceType.forValue(nic.getType()).name()); if (vmDevice.getBootOrder() > 0) { map.add("bootOrder", String.valueOf(vmDevice.getBootOrder())); } if (nic.isPortMirroring()) { <START> struct.add(VdsProperties.portMirroring, Collections.singletonList(nic.getNetworkName())); <END> } return map; }</code><technical_language>portMirroring element of "map", "macAddr", element of "struct"</technical_language>

Target:
private XmlRpcStruct initNicStructure() { XmlRpcStruct map = new XmlRpcStruct(); VmNetworkInterface nic = getParameters().getNic(); VmDevice vmDevice = getParameters().getVmDevice(); map.add("type", "interface"); map.add("device", "bridge"); map.add("macAddr", nic.getMacAddress()); map.add("network", nic.getNetworkName()); addAddress(map, vmDevice.getAddress()); map.add("specParams", vmDevice.getSpecParams()); map.add("nicModel", VmInterfaceType.forValue(nic.getType()).name()); if (vmDevice.getBootOrder() > 0) { map.add("bootOrder", String.valueOf(vmDevice.getBootOrder())); } if (nic.isPortMirroring()) { map.add(VdsProperties.portMirroring, Collections.singletonList(nic.getNetworkName())); } return map; }
Source:
<code>private boolean read(EpollRecvByteAllocatorHandle allocHandle, ByteBuf byteBuf, int maxDatagramPacketSize) throws IOException { try { <START> allocHandle.attemptedBytesRead(byteBuf.writableBytes()); <END> final DatagramSocketAddress remoteAddress; if (byteBuf.hasMemoryAddress()) { remoteAddress = socket.recvFromAddress( byteBuf.memoryAddress(), byteBuf.writerIndex(), byteBuf.capacity()); } else { ByteBuffer nioData = byteBuf.internalNioBuffer( byteBuf.writerIndex(), byteBuf.writableBytes()); remoteAddress = socket.recvFrom(nioData, nioData.position(), nioData.limit()); } if (remoteAddress == null) { allocHandle.lastBytesRead(-1); return false; } InetSocketAddress localAddress = remoteAddress.localAddress(); if (localAddress == null) { localAddress = localAddress(); } allocHandle.lastBytesRead(maxDatagramPacketSize <= 0 ? remoteAddress.receivedAmount() : maxDatagramPacketSize); byteBuf.writerIndex(byteBuf.writerIndex() + allocHandle.lastBytesRead()); allocHandle.incMessagesRead(1); pipeline().fireChannelRead(new DatagramPacket(byteBuf, localAddress, remoteAddress)); byteBuf = null; return true; } finally { if (byteBuf != null) { byteBuf.release(); } } }</code><technical_language>I in maxDatagramPacketSize != 0 case, pass min(byteBuf.writableBytes(), maxDatagramPacketSize) here, similarly changed lastBytesRead min ... (could allocHandle.attemptedBytesRead())</technical_language>

Target:
private boolean read(EpollRecvByteAllocatorHandle allocHandle, ByteBuf byteBuf, int maxDatagramPacketSize) throws IOException { try { int writable = maxDatagramPacketSize != 0 ? Math.min(byteBuf.writableBytes(), maxDatagramPacketSize) : byteBuf.writableBytes(); allocHandle.attemptedBytesRead(writable); int writerIndex = byteBuf.writerIndex(); final DatagramSocketAddress remoteAddress; if (byteBuf.hasMemoryAddress()) { remoteAddress = socket.recvFromAddress( byteBuf.memoryAddress(), writerIndex, writerIndex + writable); } else { ByteBuffer nioData = byteBuf.internalNioBuffer(writerIndex, writable); remoteAddress = socket.recvFrom(nioData, nioData.position(), nioData.limit()); } if (remoteAddress == null) { allocHandle.lastBytesRead(-1); return false; } InetSocketAddress localAddress = remoteAddress.localAddress(); if (localAddress == null) { localAddress = localAddress(); } allocHandle.lastBytesRead(maxDatagramPacketSize <= 0 ? remoteAddress.receivedAmount() : writable); byteBuf.writerIndex(byteBuf.writerIndex() + allocHandle.lastBytesRead()); allocHandle.incMessagesRead(1); pipeline().fireChannelRead(new DatagramPacket(byteBuf, localAddress, remoteAddress)); byteBuf = null; return true; } finally { if (byteBuf != null) { byteBuf.release(); } } }
Source:
<code>private Class<?> createLinkToInterface(final Class<?> controller, String interfaceName) { try { return Class.forName(interfaceName); } catch (ClassNotFoundException e1) { } final Set<CtMethod> used = new HashSet<>(); ClassPool pool = ClassPool.getDefault(); CtClass inter = pool.makeInterface(interfaceName); try { CtClass returnType = pool.get(String.class.getName()); CtClass objectType = pool.get(Object.class.getName()); for (Method m : getMethods(controller)) { String name = m.getName(); CtClass[] params = createParameters(objectType, m.getParameterTypes().length); CtClass[] empty = new CtClass[0]; <START> for (int length = params.length; length >= 0; length--) { <END> CtMethod method = abstractMethod(returnType, name, params, empty, inter); if (!used.contains(method)) { used.add(method); inter.addMethod(method); logger.debug("added method to interface {}", method.getName(), controller); } } CtMethod getter = abstractMethod(returnType, String.format("get%s", capitalize(name)), empty, empty, inter); if (!used.contains(getter)) { used.add(getter); inter.addMethod(getter); logger.debug("added getter to interface {}", getter.getName(), controller); } } return inter.toClass(); } catch (CannotCompileException | NotFoundException e) { throw new ProxyCreationException(e); } }</code><technical_language>length here... Arrays.copyOf(params, length) abstractMethod</technical_language>

Target:
private Class<?> createLinkToInterface(final Class<?> controller, String interfaceName) { try { return Class.forName(interfaceName); } catch (ClassNotFoundException e1) { } final Set<CtMethod> used = new HashSet<>(); ClassPool pool = ClassPool.getDefault(); CtClass inter = pool.makeInterface(interfaceName); try { CtClass returnType = pool.get(String.class.getName()); CtClass objectType = pool.get(Object.class.getName()); for (Method m : getMethods(controller)) { String name = m.getName(); CtClass[] params = createParameters(objectType, m.getParameterTypes().length); CtClass[] empty = new CtClass[0]; for (int length = params.length; length >= 0; length--) { CtMethod method = abstractMethod(returnType, m.getName(), Arrays.copyOf(params, length), empty, inter); if (!used.contains(method)) { used.add(method); inter.addMethod(method); logger.debug("added method to interface {}", method.getName(), controller); } } CtMethod getter = abstractMethod(returnType, String.format("get%s", capitalize(name)), empty, empty, inter); if (!used.contains(getter)) { used.add(getter); inter.addMethod(getter); logger.debug("added getter to interface {}", getter.getName(), controller); } } return inter.toClass(); } catch (CannotCompileException | NotFoundException e) { throw new ProxyCreationException(e); } }
Source:
<code>protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " s.id" + " from properties s" + " where" + " s.resource_id is not null" + " and not exists (" + " select" + " 1" + " from projects p" + " where" + " p.id = s.resource_id" + " and p.scope = ?" + " and p.qualifier in (?,?,?,?)" + <START> " )") <END> .setString(1, SCOPE_PROJECT) .setString(2, QUALIFIER_PROJECT) .setString(3, QUALIFIER_VIEW) .setString(4, QUALIFIER_MODULE) .setString(5, QUALIFIER_SUBVIEW); massUpdate.update("delete from properties where id = ?"); massUpdate.rowPluralName("orphan properties"); massUpdate.execute(CleanOrphanRowsInProperties::handle); }</code><technical_language>p.enabled=true added</technical_language>

Target:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " s.id" + " from properties s" + " where" + " s.resource_id is not null" + " and not exists (" + " select" + " 1" + " from projects p" + " where" + " p.id = s.resource_id" + " and p.scope = ?" + " and p.qualifier in (?,?,?,?)" + " and p.enabled = ?" + " )") .setString(1, SCOPE_PROJECT) .setString(2, QUALIFIER_PROJECT) .setString(3, QUALIFIER_VIEW) .setString(4, QUALIFIER_MODULE) .setString(5, QUALIFIER_SUBVIEW) .setBoolean(6, true); massUpdate.update("delete from properties where id = ?"); massUpdate.rowPluralName("orphan properties"); massUpdate.execute(CleanOrphanRowsInProperties::handle); }
Source:
<code>private void addStorageQuotaColumn() { if (!importModel.isQuotaEnabled()) { return; } if (quotaColumn != null) { return; } CustomSelectionCell customSelectionCellQuota = new CustomSelectionCell(new ArrayList<String>()); <START> customSelectionCellQuota.setStyle(""); END> quotaColumn = new Column<DiskImage, String>(customSelectionCellQuota) { @Override public String getValue(DiskImage disk) { ImportDiskData importData = importModel.getDiskImportData(disk.getId()); ArrayList<String> storageQuotaList = new ArrayList<>(); Quota selectedQuota = null; if (importData != null && importData.getQuotaList() != null) { for (Quota quota : importData.getQuotaList()) { storageQuotaList.add(quota.getQuotaName()); if (importData.getSelectedQuota() != null) { if (quota.getId().equals(importData.getSelectedQuota().getId())) { selectedQuota = quota; } } } } ((CustomSelectionCell) getCell()).setOptions(storageQuotaList); if (!storageQuotaList.isEmpty()) { if (selectedQuota != null) { return selectedQuota.getQuotaName(); } else { return storageQuotaList.get(0); } } return ""; } }; quotaColumn.setFieldUpdater(new FieldUpdater<DiskImage, String>() { @Override public void update(int index, DiskImage disk, String value) { importModel.getDiskImportData(disk.getId()).setSelectedQuotaString(value); } }); diskTable.addColumn(quotaColumn, constants.quota(), "100px"); }</code><technical_language>necessary</technical_language>

Target:
private void addStorageQuotaColumn() { if (!importModel.isQuotaEnabled()) { return; } if (quotaColumn != null) { return; } CustomSelectionCell customSelectionCellQuota = new CustomSelectionCell(new ArrayList<String>()); customSelectionCellQuota.setStyle(EMPTY_STYLE); quotaColumn = new Column<DiskImage, String>(customSelectionCellQuota) { @Override public String getValue(DiskImage disk) { ImportDiskData importData = importModel.getDiskImportData(disk.getId()); ArrayList<String> storageQuotaList = new ArrayList<>(); Quota selectedQuota = null; if (importData != null && importData.getQuotaList() != null) { for (Quota quota : importData.getQuotaList()) { storageQuotaList.add(quota.getQuotaName()); if (importData.getSelectedQuota() != null) { if (quota.getId().equals(importData.getSelectedQuota().getId())) { selectedQuota = quota; } } } } ((CustomSelectionCell) getCell()).setOptions(storageQuotaList); if (!storageQuotaList.isEmpty()) { if (selectedQuota != null) { return selectedQuota.getQuotaName(); } else { return storageQuotaList.get(0); } } return ""; } }; quotaColumn.setFieldUpdater(new FieldUpdater<DiskImage, String>() { @Override public void update(int index, DiskImage disk, String value) { importModel.getDiskImportData(disk.getId()).setSelectedQuotaString(value); } }); diskTable.addColumn(quotaColumn, constants.quota(), "100px"); }
Source:
<code>protected void initializeContainer(FIELD field, FieldElement fieldElement) { <START> String containerSetting = fieldElement.getParams().get("nestedFormContainer"); <END> if(containerSetting != null) { try { Container container = Container.valueOf(containerSetting); field.setContainer(container); } catch (Exception ex){} } }</code><technical_language>I this "nestedFormContainer" string places... a constant? other params in some enum.... I this much</technical_language>

Target:
protected void initializeContainer(FIELD field, FieldElement fieldElement) { String containerSetting = fieldElement.getParams().get(FIELD_CONTAINER_PARAM); if (containerSetting != null) { try { Container container = Container.valueOf(containerSetting); field.setContainer(container); } catch (Exception ex) { } } }
Source:
<code><START> public ContentletSystemEventUtil(SystemEventsAPI systemEventsAPI){ <END> this.systemEventsAPI = systemEventsAPI; }</code><technical_language>This protected if Test is in package</technical_language>

Target:
protected ContentletSystemEventUtil(SystemEventsAPI systemEventsAPI){ this.systemEventsAPI = systemEventsAPI; }
Source:
<code>private void handleDetails(LookData lookData, LookViewHolder holder, LookBaseAdapter lookAdapter) { if (lookAdapter.getShowDetails()) { if (lookData.getAbsolutePath() != null) { holder.lookFileSizeTextView.setText(UtilFile.getSizeAsString(new File(lookData.getAbsolutePath()))); } int[] measure = lookData.getMeasure(); int Length = measure[0]; <START> int Width = measure[1]; <END> String measureString = String.format(Locale.getDefault(), "%d", Length) + " x " + String.format(Locale.getDefault(), "%d", Width); holder.lookMeasureTextView.setText(measureString); holder.lookDetailsLinearLayout.setVisibility(TextView.VISIBLE); } else { holder.lookDetailsLinearLayout.setVisibility(TextView.GONE); } }</code><technical_language>This code is working correctly, is a mixup naming of local variables: lookData.getMeasure() return array this: {width, height} 'Length' renamed 'width' 'Width' renamed 'height'. (Those local variables written in camelCase, else checkstyle complain ;) )</technical_language>

Target:
private void handleDetails(LookData lookData, LookViewHolder holder, LookBaseAdapter lookAdapter) { if (lookAdapter.getShowDetails()) { if (lookData.getAbsolutePath() != null) { holder.lookFileSizeTextView.setText(UtilFile.getSizeAsString(new File(lookData.getAbsolutePath()))); } int[] measure = lookData.getMeasure(); int width = measure[0]; int height = measure[1]; String measureString = String.format(Locale.getDefault(), "%d", width) + " x " + String.format(Locale .getDefault(), "%d", height); holder.lookMeasureTextView.setText(measureString); holder.lookDetailsLinearLayout.setVisibility(TextView.VISIBLE); } else { holder.lookDetailsLinearLayout.setVisibility(TextView.GONE); } }
Source:
<code>public static RecordWriter createParquetWriter(Path target, JobConf conf, Properties properties, boolean compress, ConnectorSession session) throws IOException, ReflectiveOperationException { <START> conf.setLong(ParquetOutputFormat.BLOCK_SIZE, HiveSessionProperties.getParquetWriterBlockSize(session).toBytes()); <END> conf.setLong(ParquetOutputFormat.PAGE_SIZE, HiveSessionProperties.getParquetWriterPageSize(session).toBytes()); RecordWriter recordWriter = new MapredParquetOutputFormat() .getHiveRecordWriter(conf, target, Text.class, compress, properties, Reporter.NULL); Object realWriter = REAL_WRITER_FIELD.get(recordWriter); Object internalWriter = INTERNAL_WRITER_FIELD.get(realWriter); ParquetFileWriter fileWriter = (ParquetFileWriter) FILE_WRITER_FIELD.get(internalWriter); return new ExtendedRecordWriter() { private long length; @Override public long getWrittenBytes() { return length; } @Override public void write(Writable value) throws IOException { recordWriter.write(value); length = fileWriter.getPos(); } @Override public void close(boolean abort) throws IOException { recordWriter.close(abort); if (!abort) { length = target.getFileSystem(conf).getFileStatus(target).getLen(); } } }; }</code><technical_language>static import HiveSessionProperties.getParquetWriter* methods</technical_language>

Target:
public static RecordWriter createParquetWriter(Path target, JobConf conf, Properties properties, boolean compress, ConnectorSession session) throws IOException, ReflectiveOperationException { conf.setLong(ParquetOutputFormat.BLOCK_SIZE, getParquetWriterBlockSize(session).toBytes()); conf.setLong(ParquetOutputFormat.PAGE_SIZE, getParquetWriterPageSize(session).toBytes()); RecordWriter recordWriter = new MapredParquetOutputFormat() .getHiveRecordWriter(conf, target, Text.class, compress, properties, Reporter.NULL); Object realWriter = REAL_WRITER_FIELD.get(recordWriter); Object internalWriter = INTERNAL_WRITER_FIELD.get(realWriter); ParquetFileWriter fileWriter = (ParquetFileWriter) FILE_WRITER_FIELD.get(internalWriter); return new ExtendedRecordWriter() { private long length; @Override public long getWrittenBytes() { return length; } @Override public void write(Writable value) throws IOException { recordWriter.write(value); length = fileWriter.getPos(); } @Override public void close(boolean abort) throws IOException { recordWriter.close(abort); if (!abort) { length = target.getFileSystem(conf).getFileStatus(target).getLen(); } } }; }
Source:
<code>public void onNext(CorfuStreamEntries results) { synchronized (discoveryService) { if (!discoveryService.getIsLeader().get()) { log.info("The onNext call with will be skipped as the current node as it is not the leader.", results); return; } log.info("LogReplicationEventListener onNext will be processed at node in the cluster {}", results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); for (List<CorfuStreamEntry> entryList : results.getEntries().values()) { for (CorfuStreamEntry entry : entryList) { ReplicationEvent event = (ReplicationEvent) entry.getPayload(); log.info("ReplicationEventListener put an event to its local discoveryServiceQueue", event); <START> discoveryService.input(new DiscoveryServiceEvent( <END> DiscoveryServiceEvent.DiscoveryServiceEventType.ENFORCE_SNAPSHOT_SYNC, event.getClusterId(), event.getEventId())); } } } }</code><technical_language>add log.info data relevant event processed? I ReplicationEvent String annotation overwrite print reference</technical_language>

Target:
public void onNext(CorfuStreamEntries results) { synchronized (discoveryService) { if (!discoveryService.getIsLeader().get()) { log.info("The onNext call with will be skipped as the current node as it is not the leader.", results); return; } log.info("LogReplicationEventListener onNext will be processed at node in the cluster {}", results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); for (List<CorfuStreamEntry> entryList : results.getEntries().values()) { for (CorfuStreamEntry entry : entryList) { ReplicationEvent event = (ReplicationEvent) entry.getPayload(); log.info("ReplicationEventListener received an event with id {}, type {}, cluster id {}", event.getEventId(), event.getType(), event.getClusterId()); if (event.getType().equals(ReplicationEvent.ReplicationEventType.FORCE_SNAPSHOT_SYNC)) { discoveryService.input(new DiscoveryServiceEvent( DiscoveryServiceEvent.DiscoveryServiceEventType.ENFORCE_SNAPSHOT_SYNC, event.getClusterId(), event.getEventId())); } } } } }
Source:
<code>public void checkWfswarmRestHttpProjectCommands() { consoles.executeCommandFromProjectExplorer( PROJECT_NAME, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "WildFly Swarm is Ready"); <START> consoles.checkWebElementVisibilityAtPreviewPage(By.xpath(" END> }</code><technical_language>clear "//h2[@id='_http_booster']" is about. this point name string somehow</technical_language>

Target:
public void checkWfswarmRestHttpProjectCommands() { By textOnPreviewPage = By.xpath(" consoles.executeCommandFromProjectExplorer( PROJECT_NAME, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "WildFly Swarm is Ready"); consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); }
Source:
<code>public List<Map<String, String>> linkify(HttpServletRequest req, String message) { List<CommentLinkInfo> operationalCommentLinks = new ArrayList<>(commentLinks); String baseGerritUrl = urls.getBaseGerritUrl(req); if (baseGerritUrl != null) { <START> System.out.println("baseGerritUrl: " + baseGerritUrl); <END> CommentLinkInfo changeIds = new CommentLinkInfo(CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$0,n,z"); operationalCommentLinks.add(changeIds); } List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { if (parsed.get(index).get("url") != null) { continue; } Matcher m = allPattern.matcher(parsed.get(index).get("text")); if (!m.find()) { continue; } for (CommentLinkInfo cli : operationalCommentLinks) { if (parsed.get(index).get("url") != null) { break; } List<Map<String, String>> resultingReplacement = cli.replace(parsed.get(index).get("text")); if (resultingReplacement != null) { parsed.remove(index); parsed.addAll(index, resultingReplacement); } } } return parsed; }</code><technical_language>stray debugging statement</technical_language>

Target:
public List<Map<String, String>> linkify(HttpServletRequest req, String message) { List<CommentLinkInfo> operationalCommentLinks = new ArrayList<>(commentLinks); String baseGerritUrl = urls.getBaseGerritUrl(req); if (baseGerritUrl != null) { CommentLinkInfo changeIds = new CommentLinkInfo(CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$0,n,z"); operationalCommentLinks.add(changeIds); } List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { if (parsed.get(index).get("url") != null) { continue; } Matcher m = allPattern.matcher(parsed.get(index).get("text")); if (!m.find()) { continue; } for (CommentLinkInfo cli : operationalCommentLinks) { if (parsed.get(index).get("url") != null) { break; } String text = parsed.get(index).get("text"); List<Map<String, String>> resultingReplacement = cli.linkify(text); parsed.remove(index); parsed.addAll(index, resultingReplacement); } } return parsed; }
Source:
<code>public Object status(@PathParam("executionId") String executionId) throws IOException, URISyntaxException, MessagingException { if (isCompleted(executionId)) { String error = getError(executionId); if (error != null) { <START> throw new NuxeoException(error, Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); <END> } String resURL = StringUtils.stripEnd(ctx.getURL(), "/status"); return redirect(resURL); } else { Object result = "RUNNING"; if (isAsync(executionId)) { Serializable commandId = getCommandId(executionId); result = getAsyncService(executionId).getStatus(commandId); } return ResponseHelper.getResponse(result, request, Response.Status.OK.getStatusCode()); } }</code><technical_language>discussed, target is a thread pool to: - limit number of threads generated handle async operation: thread pool bounded, a rejection policy returns error (like 503 server busy retry later) - a clean shutdown Also, thread uncaughtExceptionHandler need track of threads handle abort</technical_language>

Target:
public Object status(@PathParam("executionId") String executionId) throws IOException, URISyntaxException, MessagingException { if (isCompleted(executionId)) { String error = getError(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } String resURL = StringUtils.removeEnd(ctx.getURL(), STATUS_PATH); return redirect(resURL); } else { Object result = RUNNING_STATUS; if (isAsync(executionId)) { Serializable taskId = getTaskId(executionId); result = getAsyncService(executionId).getStatus(taskId); } return ResponseHelper.getResponse(result, request, HttpServletResponse.SC_OK); } }
Source:
<code>public NGuid getStorageDomainId() { if (_storageDomainId.equals(Guid.Empty) && getVm() != null) { <START> long sizeNeeded = getVm().getTotalMemorySizeInBytes() / BYTES_IN_GB; <END> StorageDomain storageDomain = VmHandler.findStorageDomainForMemory(getVm().getStoragePoolId(), sizeNeeded); if (storageDomain != null) { _storageDomainId = storageDomain.getId(); } } return _storageDomainId; }</code><technical_language>This truncate closest size in GB. do division in doubles a long</technical_language>

Target:
public NGuid getStorageDomainId() { if (cachedStorageDomainId.equals(Guid.Empty) && getVm() != null) { long sizeNeeded = getVm().getTotalMemorySizeInBytes() / BYTES_IN_GB; StorageDomain storageDomain = VmHandler.findStorageDomainForMemory(getVm().getStoragePoolId(), sizeNeeded); if (storageDomain != null) { cachedStorageDomainId = storageDomain.getId(); } } return cachedStorageDomainId; }
Source:
<code>public void testRecursiveTheirsStrategy() throws GitException, InterruptedException { mergeCmd.setStrategy(MergeCommand.Strategy.RECURSIVE_THEIRS).setRevisionToMerge(commit1Branch2).execute(); <START> assertTrue("branch 2 commit 1 not on master branch after merge", git.revList("master").contains(commit1Branch2)); <END> }</code><technical_language>Thanks for writing test confirm strategy option is accepted. willing include assertion in test confirms behavior of option expected? For example, assert contents of merged file expected</technical_language>

Target:
public void testRecursiveTheirsStrategy() throws GitException, InterruptedException, FileNotFoundException, IOException { mergeCmd.setStrategy(MergeCommand.Strategy.RECURSIVE_THEIRS).setRevisionToMerge(commit1Branch2).execute(); assertTrue("branch 2 commit 1 not on master branch after merge", git.revList("master").contains(commit1Branch2)); assertTrue("README.md is missing on master", readme.exists()); try(FileReader reader = new FileReader(readme); BufferedReader br = new BufferedReader(reader)) { assertTrue("README.md does not contain expected content", br.readLine().startsWith(BRANCH_2_README_CONTENT)); } }
Source:
<code>public EntryVersionsMap createNewVersionsAndCheckForWriteSkews(VersionGenerator versionGenerator, TxInvocationContext context, VersionedPrepareCommand prepareCommand) { CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); <START> if (cacheTopology == null || prepareCommand.getModifications().length == 0) { <END> context.getCacheTransaction().setUpdatedEntryVersions(new EntryVersionsMap()); } else { ConsistentHash readConsistentHash = cacheTopology.getReadConsistentHash(); List<Address> members = readConsistentHash.getMembers(); if (members.get(0).equals(rpcManager.getAddress())) { EntryVersionsMap uv = performWriteSkewCheckAndReturnNewVersions( prepareCommand, dataContainer, versionGenerator, context, keySpecificLogic); context.getCacheTransaction().setUpdatedEntryVersions(uv); return uv; } } return null; }</code><technical_language>prepareCommand.getModifications() check enough for preload, preload CACHE_MODE_LOCAL. throw exception if cacheTopology == null CACHE_MODE_LOCAL flag is used</technical_language>

Target:
public EntryVersionsMap createNewVersionsAndCheckForWriteSkews(VersionGenerator versionGenerator, TxInvocationContext context, VersionedPrepareCommand prepareCommand) { CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); if (prepareCommand.getModifications().length == 0) { context.getCacheTransaction().setUpdatedEntryVersions(new EntryVersionsMap()); } else { ConsistentHash readConsistentHash = cacheTopology.getReadConsistentHash(); List<Address> members = readConsistentHash.getMembers(); if (members.get(0).equals(rpcManager.getAddress())) { EntryVersionsMap uv = performWriteSkewCheckAndReturnNewVersions( prepareCommand, dataContainer, versionGenerator, context, keySpecificLogic); context.getCacheTransaction().setUpdatedEntryVersions(uv); return uv; } } return null; }
Source:
<code><START> public boolean isContainsOwnerPostsOnly() { <END> for (Post post : getDisplayedPosts()) { if (post.getUserCreated().equals(topicStarter)) { return false; } } return true; }</code><technical_language>forget unit tests</technical_language>

Target:
public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { if (!post.getUserCreated().equals(topicStarter)) { return false; } } return true; }
Source:
<code><START> protected DynamicConstants(final CommonApplicationConstants gwtConstants) { <END> this.constants = gwtConstants; dictionary = null; try { dictionary = Dictionary.getDictionary(MESSAGES_DICTIONARY_NAME); } catch (MissingResourceException mre) { mre.printStackTrace(); } }</code><technical_language>is this constructor protected</technical_language>

Target:
public DynamicConstants(final CommonApplicationConstants gwtConstants) { this.constants = gwtConstants; dictionary = null; try { dictionary = Dictionary.getDictionary(MESSAGES_DICTIONARY_NAME); } catch (MissingResourceException mre) { } }
Source:
<code>public Instance getWorkingInstance(String zone, String name, String flavorId, int size) { InstanceApi instanceApi = api.getInstanceApiForZone(zone); for (int retries = 0; retries < 10; retries++) { Instance instance = null; try { instance = instanceApi.create(flavorId, size, name); } catch (Exception e) { try { Thread.sleep(50); } catch (InterruptedException ie) { } logger.error(e.getStackTrace().toString()); continue; } Instance updatedInstance = awaitAvailable(instance, instanceApi); if (updatedInstance == null) { instanceApi.delete(instance.getId()); InstancePredicates.awaitDeleted(instanceApi).apply(instance); continue; } <START> return updatedInstance; <END> } return null; }</code><technical_language>a style thing, read more easily if "exit case" more explicit? I.e. if (updatedInstance != null) { return updatedInstance; } instanceApi.delete(instance.getId()); InstancePredicates.awaitDeleted(instanceApi).apply(instance); ..</technical_language>

Target:
public Instance getWorkingInstance(String zone, String name, String flavorId, int size) { InstanceApi instanceApi = api.getInstanceApiForZone(zone); for (int retries = 0; retries < 10; retries++) { Instance instance = null; try { instance = instanceApi.create(flavorId, size, name); } catch (Exception e) { Uninterruptibles.sleepUninterruptibly(15, TimeUnit.SECONDS); logger.error(e.getStackTrace().toString()); continue; } Instance updatedInstance = awaitAvailable(instance, instanceApi); if (updatedInstance != null) { return updatedInstance; } instanceApi.delete(instance.getId()); InstancePredicates.awaitDeleted(instanceApi).apply(instance); } return null; }
Source:
<code>public List<BitmexMarginAccount> getBitmexMarginAccountsStatus() throws IOException { try { return bitmex.getMarginAccountsStatus(apiKey, exchange.getNonceFactory(), signatureCreator); } catch (BitmexException e) { <START> throw new ExchangeException(e); <END> } }</code><technical_language>handle exceptions a handle exceptions method in BitmexBaseService. GDAX impl. develop. way, easier for clients handle types of exceptions</technical_language>

Target:
public List<BitmexMarginAccount> getBitmexMarginAccountsStatus() throws IOException { try { return bitmex.getMarginAccountsStatus(apiKey, exchange.getNonceFactory(), signatureCreator); } catch (BitmexException e) { throw handleError(e); } }
Source:
<code>protected ProjectState( final ProjectCache projectCache, final AllProjectsName allProjectsName, final ProjectControl.AssistedFactory projectControlFactory, final PrologEnvironment.Factory envFactory, final GitRepositoryManager gitMgr, final RulesCache rulesCache, @Assisted final ProjectConfig config) { this.projectCache = projectCache; this.isAllProjects = config.getProject().getNameKey().equals(allProjectsName); this.allProjectsName = allProjectsName; this.projectControlFactory = projectControlFactory; this.envFactory = envFactory; this.gitMgr = gitMgr; this.rulesCache = rulesCache; this.config = config; this.capabilities = isAllProjects <START> ? new CapabilityCollection(config.getProject().getNameKey(), config.getAccessSection(AccessSection.GLOBAL_CAPABILITIES)) <END> : null; if (isAllProjects && !Permission.canBeOnAllProjects(AccessSection.ALL, Permission.OWNER)) { localOwners = Collections.emptySet(); } else { HashSet<AccountGroup.UUID> groups = new HashSet<AccountGroup.UUID>(); AccessSection all = config.getAccessSection(AccessSection.ALL); if (all != null) { Permission owner = all.getPermission(Permission.OWNER); if (owner != null) { for (PermissionRule rule : owner.getRules()) { GroupReference ref = rule.getGroup(); if (ref.getUUID() != null) { groups.add(ref.getUUID()); } } } } localOwners = Collections.unmodifiableSet(groups); } }</code><technical_language>This line is a bit long now. Line wrap arguments</technical_language>

Target:
protected ProjectState( final ProjectCache projectCache, final AllProjectsName allProjectsName, final ProjectControl.AssistedFactory projectControlFactory, final PrologEnvironment.Factory envFactory, final GitRepositoryManager gitMgr, final RulesCache rulesCache, @Assisted final ProjectConfig config) { this.projectCache = projectCache; this.isAllProjects = config.getProject().getNameKey().equals(allProjectsName); this.allProjectsName = allProjectsName; this.projectControlFactory = projectControlFactory; this.envFactory = envFactory; this.gitMgr = gitMgr; this.rulesCache = rulesCache; this.config = config; this.capabilities = isAllProjects ? new CapabilityCollection(config.getAccessSection(AccessSection.GLOBAL_CAPABILITIES)) : null; if (isAllProjects && !Permission.canBeOnAllProjects(AccessSection.ALL, Permission.OWNER)) { localOwners = Collections.emptySet(); } else { HashSet<AccountGroup.UUID> groups = new HashSet<AccountGroup.UUID>(); AccessSection all = config.getAccessSection(AccessSection.ALL); if (all != null) { Permission owner = all.getPermission(Permission.OWNER); if (owner != null) { for (PermissionRule rule : owner.getRules()) { GroupReference ref = rule.getGroup(); if (ref.getUUID() != null) { groups.add(ref.getUUID()); } } } } localOwners = Collections.unmodifiableSet(groups); } }
Source:
<code>public StormJaasCreator() { URL templateFileUrl = getClass().getClassLoader().getResource(STORM_JAAS_CONFIG_TEMPLATE); if (templateFileUrl == null) { throw new RuntimeException("Unable to read JAAS template file for Storm."); } try { stormJaasConfigTemplate = FileUtils.readFileToString(new File(templateFileUrl.toURI()), Charset.defaultCharset()); } catch (IOException | URISyntaxException e) { throw new RuntimeException("Unable to read JAAS template file for Storm."); } Configuration configuration = Configuration.getConfiguration(); <START> AppConfigurationEntry[] streamlineConfigurations = configuration.getAppConfigurationEntry("StreamlineServer"); <END> if (streamlineConfigurations == null || streamlineConfigurations.length == 0) { throw new RuntimeException("Streamline is not initialized with JAAS config. Unable to create JAAS for Storm."); } AppConfigurationEntry streamlineConf = streamlineConfigurations[0]; Map<String, ?> options = streamlineConf.getOptions(); keyTabPath = (String) options.get("keyTab"); streamlinePrincipal = (String) options.get("principal"); }</code><technical_language>I SrtreamlineServer hard coded in PR too. I thought elsewhere. add a constant? I change code constant</technical_language>

Target:
public StormJaasCreator() { URL templateFileUrl = getClass().getClassLoader().getResource(STORM_JAAS_CONFIG_TEMPLATE); if (templateFileUrl == null) { throw new RuntimeException("Unable to read JAAS template file for Storm."); } try { stormJaasConfigTemplate = FileUtils.readFileToString(new File(templateFileUrl.toURI()), Charset.defaultCharset()); } catch (IOException | URISyntaxException e) { throw new RuntimeException("Unable to read JAAS template file for Storm."); } Configuration configuration = Configuration.getConfiguration(); AppConfigurationEntry[] streamlineConfigurations = configuration.getAppConfigurationEntry(Constants.JAAS_STREAMLINE_APP_CONFIG_ENTRY_NAME); if (streamlineConfigurations == null || streamlineConfigurations.length == 0) { throw new RuntimeException("Streamline is not initialized with JAAS config. Unable to create JAAS for Storm."); } AppConfigurationEntry streamlineConf = streamlineConfigurations[0]; Map<String, ?> options = streamlineConf.getOptions(); keyTabPath = (String) options.get("keyTab"); streamlinePrincipal = (String) options.get("principal"); }
Source:
<code>public Response doExport(Action action) { validateParameters(action, "storageDomain.id|name"); try { ExportRepoImageParameters exportParameters = DiskHelper.getExportRepoImageParameters(get(), getStorageDomainId(action)); return doAction(VdcActionType.ExportRepoImage, exportParameters, action); } catch (Exception e) { return handleError(e, action); <START> } <END> }</code><technical_language>need for failover treatment, this is done infra, return doAction()</technical_language>

Target:
public Response doExport(Action action) { validateParameters(action, "storageDomain.id|name"); Disk disk = get(); Guid sourceStorageDomainId = new Guid(disk.getStorageDomains().getStorageDomains().get(0).getId()); Guid sourceStoragePoolId = StorageDomainHelper.getStoragePoolIdForDomain(this, sourceStorageDomainId); ExportRepoImageParameters exportParameters = new ExportRepoImageParameters(new Guid(disk.getImageId())); exportParameters.setStoragePoolId(sourceStoragePoolId); exportParameters.setStorageDomainId(sourceStorageDomainId); exportParameters.setImageGroupID(new Guid(disk.getId())); exportParameters.setDestinationDomainId(getStorageDomainId(action)); return doAction(VdcActionType.ExportRepoImage, exportParameters, action); }
Source:
<code>protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsHolder) { <START> if (file.isScratchFile()) return; <END> GoPackageClause packageClause = file.getPackage(); if (packageClause != null) { String packageName = file.getPackageName(); if (packageName == null || packageName.equals(GoConstants.DOCUMENTATION)) return; PsiDirectory dir = file.getContainingDirectory(); Collection<String> packages = GoUtil.getAllPackagesInDirectory(dir, true); packages.remove(GoConstants.DOCUMENTATION); if (packages.size() > 1) { Collection<LocalQuickFix> fixes = ContainerUtil.newArrayList(); if (problemsHolder.isOnTheFly()) { fixes.add(new GoMultiplePackagesQuickFix(packageClause, packageName, packages, true)); } else { for (String name : packages) { fixes.add(new GoMultiplePackagesQuickFix(packageClause, name, packages, false)); } } problemsHolder.registerProblem(packageClause, "Multiple packages in directory", fixes.toArray(new LocalQuickFix[fixes.size()])); } } }</code><technical_language>bad idea include changes related review</technical_language>

Target:
protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsHolder) { if (((ScratchFileType)ScratchFileType.INSTANCE).isMyFileType(file.getVirtualFile())) return; GoPackageClause packageClause = file.getPackage(); if (packageClause != null) { String packageName = file.getPackageName(); if (packageName == null || packageName.equals(GoConstants.DOCUMENTATION)) return; PsiDirectory dir = file.getContainingDirectory(); Collection<String> packages = GoUtil.getAllPackagesInDirectory(dir, true); packages.remove(GoConstants.DOCUMENTATION); if (packages.size() > 1) { Collection<LocalQuickFix> fixes = ContainerUtil.newArrayList(); if (problemsHolder.isOnTheFly()) { fixes.add(new GoMultiplePackagesQuickFix(packageClause, packageName, packages, true)); } else { for (String name : packages) { fixes.add(new GoMultiplePackagesQuickFix(packageClause, name, packages, false)); } } problemsHolder.registerProblem(packageClause, "Multiple packages in directory", fixes.toArray(new LocalQuickFix[fixes.size()])); } } }