id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
16,301
public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { addTextSimple(stream, textConfig, textX, textY, text); try { float lineOffset = textConfig.getFontSize() / 8F; stream.setStrokingColor(textConfig.getColor()); <BUG>stream.setLineWidth(0.5F); stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset); </BUG> stream.stroke(); } catch (IOException e) {
stream.moveTo(textX, textY - lineOffset); stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
16,302
list.add(text.length()); return list; } public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) { String endPart = ""; <BUG>String shortenedText = text; List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {</BUG> String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0)); StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {
16,303
package cc.catalysts.boot.report.pdf.elements; import org.apache.pdfbox.pdmodel.PDDocument; <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import java.io.IOException;</BUG> import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList;
import org.apache.pdfbox.pdmodel.PDPageContentStream; import java.io.IOException;
16,304
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
16,305
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
16,306
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
16,307
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
16,308
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode { </BUG> private List<MemoEntity> memoList;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
16,309
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) { this.mActivity = activity;</BUG> this.topicId = topicId; this.memoList = memoList;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
16,310
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
16,311
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
16,312
public void testCreateConnection() { try (io.nats.client.Connection nc = setupMockNatsConnection()) { ConnectionFactory cf = new ConnectionFactory(testClusterName, testClientName); cf.setNatsConnection(nc); try (Connection sc = cf.createConnection()) { <BUG>assertTrue(sc instanceof Connection); </BUG> } catch (IOException | TimeoutException e) { e.printStackTrace(); fail(e.getMessage());
assertTrue(sc instanceof ConnectionImpl);
16,313
public ConnectionFactory() {} public ConnectionFactory(String clusterId, String clientId) { setClusterId(clusterId); setClientId(clientId); } <BUG>public ConnectionImpl createConnection() throws IOException, TimeoutException { </BUG> ConnectionImpl conn = new ConnectionImpl(clusterId, clientId, options()); conn.connect(); return conn;
public io.nats.stan.Connection createConnection() throws IOException, TimeoutException {
16,314
Map<String, Subscription> subMap; Map<String, AckClosure> pubAckMap; Channel<PubAck> pubAckChan; Options opts; io.nats.client.Connection nc; <BUG>Timer ackTimer = new Timer(true); protected ConnectionImpl() {</BUG> } ConnectionImpl(String stanClusterId, String clientId) { this(stanClusterId, clientId, new Options.Builder().create());
boolean ncOwned = false; protected ConnectionImpl() {
16,315
cf.setUrl(opts.getNatsUrl()); } return cf; } io.nats.client.Connection createNatsConnection() throws IOException, TimeoutException { <BUG>if (nc == null) { nc = createNatsConnectionFactory().createConnection(); }</BUG> return nc; }
io.nats.client.Connection nc = null; if (getNatsConnection() == null) { ncOwned = true;
16,316
if (!cr.getError().isEmpty()) { throw new IOException(cr.getError()); } } } finally { <BUG>if (nc != null) { nc.close();</BUG> } this.unlock(); }
if (ncOwned && (nc != null)) { nc.close();
16,317
nc.close();</BUG> } this.unlock(); } } <BUG>protected AckClosure createAckClosure(String guid, AckHandler ah) { return new AckClosure(guid, ah); </BUG> }
if (!cr.getError().isEmpty()) { throw new IOException(cr.getError()); } finally { if (ncOwned && (nc != null)) { nc.close(); protected AckClosure createAckClosure(AckHandler ah, Channel<Exception> ch) { return new AckClosure(ah, ch);
16,318
return new io.nats.stan.Message(msgp); } protected void processMsg(io.nats.client.Message raw) { io.nats.stan.Message stanMsg = null; boolean isClosed = false; <BUG>SubscriptionImpl sub = null; try {</BUG> logger.trace("In processMsg, msg = {}", raw); MsgProto msgp = MsgProto.parseFrom(raw.getData()); logger.trace("processMsg received MsgProto:\n{}", msgp);
io.nats.client.Connection nc = null; try {
16,319
logger.error("stan: error unmarshaling msg"); logger.debug("msg: {}", raw); logger.debug("full stack trace:", e); } lock(); <BUG>try { isClosed = (this.nc == null); sub = (SubscriptionImpl) subMap.get(raw.getSubject());</BUG> } catch (Exception e) { throw e;
nc = this.nc; isClosed = (nc == null); sub = (SubscriptionImpl) subMap.get(raw.getSubject());
16,320
public String getClientId() { return this.clientId; } protected io.nats.client.Connection getNatsConnection() { return this.nc; <BUG>} public String newInbox() {</BUG> return nc.newInbox(); } protected void lock() {
protected void setNatsConnection(io.nats.client.Connection nc) { this.nc = nc; public String newInbox() {
16,321
public ReportElement getBase() { return base; } @Override public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException { <BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false); </BUG> base.print(document, pageStream, pageNo, x, y, width); pageStream.close();
PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
16,322
public PdfTextStyle(String config) { Assert.hasText(config); String[] split = config.split(","); Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000"); fontSize = Integer.parseInt(split[0]); <BUG>font = resolveStandard14Name(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG> } public int getFontSize() { return fontSize;
font = getFont(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));
16,323
package cc.catalysts.boot.report.pdf.elements; import cc.catalysts.boot.report.pdf.config.PdfTextStyle; import cc.catalysts.boot.report.pdf.utils.ReportAlignType; import org.apache.pdfbox.pdmodel.PDPageContentStream; <BUG>import org.apache.pdfbox.pdmodel.font.PDFont; import org.slf4j.Logger;</BUG> import org.slf4j.LoggerFactory; import org.springframework.util.StringUtils; import java.io.IOException;
import org.apache.pdfbox.pdmodel.font.PDType1Font; import org.apache.pdfbox.util.Matrix; import org.slf4j.Logger;
16,324
addTextSimple(stream, textConfig, textX, nextLineY, ""); return nextLineY; } try { <BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText); </BUG> float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]); if (!underline) { addTextSimple(stream, textConfig, x, nextLineY, split[0]); } else {
String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
16,325
public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { try { stream.setFont(textConfig.getFont(), textConfig.getFontSize()); stream.setNonStrokingColor(textConfig.getColor()); stream.beginText(); <BUG>stream.newLineAtOffset(textX, textY); stream.showText(text);</BUG> } catch (Exception e) { LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage()); }
stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY)); stream.showText(text);
16,326
public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { addTextSimple(stream, textConfig, textX, textY, text); try { float lineOffset = textConfig.getFontSize() / 8F; stream.setStrokingColor(textConfig.getColor()); <BUG>stream.setLineWidth(0.5F); stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset); </BUG> stream.stroke(); } catch (IOException e) {
stream.moveTo(textX, textY - lineOffset); stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
16,327
list.add(text.length()); return list; } public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) { String endPart = ""; <BUG>String shortenedText = text; List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {</BUG> String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0)); StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {
16,328
package cc.catalysts.boot.report.pdf.elements; import org.apache.pdfbox.pdmodel.PDDocument; <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import java.io.IOException;</BUG> import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList;
import org.apache.pdfbox.pdmodel.PDPageContentStream; import java.io.IOException;
16,329
package com.bagri.tools.vvm.ui; <BUG>import java.awt.BorderLayout; import java.awt.Dimension;</BUG> import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;
import java.awt.Component; import java.awt.Dimension;
16,330
import java.util.List; import java.util.Set; import java.util.logging.Logger; import javax.management.openmbean.CompositeData; import javax.management.openmbean.TabularData; <BUG>import javax.swing.JButton; import javax.swing.JPanel;</BUG> import com.bagri.tools.vvm.event.ApplicationEvent; import com.bagri.tools.vvm.event.EventBus; import com.bagri.tools.vvm.model.Schema;
import javax.swing.JLabel; import javax.swing.JPanel;
16,331
public class SchemaCapacityPanel extends JPanel { private static final Logger LOGGER = Logger.getLogger(SchemaCapacityPanel.class.getName()); private static final int VALUES_LIMIT = 271; // number of partitions..? private final SchemaManagementService schemaService; private final EventBus<ApplicationEvent> eventBus; <BUG>private final String schemaName; private SimpleXYChartSupport chart;</BUG> public SchemaCapacityPanel(String schemaName, SchemaManagementService schemaService, EventBus<ApplicationEvent> eventBus) { super(new BorderLayout()); this.schemaName = schemaName;
private JPanel header; private SimpleXYChartSupport chart;
16,332
refresh.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onRefresh(); } <BUG>}); header.add(refresh); header.setPreferredSize(new Dimension(500, 50)); createChart();</BUG> header.setBackground(chart.getChart().getBackground());
panel.setBackground(chart.getChart().getBackground()); panel.add(refresh, BorderLayout.EAST); //CENTER); header.add(panel); header.add(new JLabel("Total indices cost:")); header.add(new JLabel("Total documents cost:")); header.add(new JLabel("Overall cost:"));
16,333
descriptor.addLineFillItems("Indexes cost"); descriptor.addLineFillItems("Documents cost"); descriptor.setChartTitle("<html><font size='+1'><b>" + schemaName + " Capacity</b></font></html>"); descriptor.setXAxisDescription("partitions"); descriptor.setYAxisDescription("cost (Kb)"); <BUG>descriptor.setDetailsItems(new String[] {"Total elements cost", "Total content cost", "Total results cost", "Total indices cost", "Total documents cost", "Overall cost"});</BUG> chart = ChartFactory.createSimpleXYChart(descriptor); onRefresh(); }
[DELETED]
16,334
docToolbar.add(remDocClns); docToolbar.addSeparator(); docToolbar.setFloatable(false); add(docToolbar, BorderLayout.PAGE_START); mgrSplitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); <BUG>mgrSplitter.setDividerLocation(0.3); mgrSplitter.setLeftComponent(createDocumentTreePanel()); mgrSplitter.setRightComponent(getCollectionManagementPanel()); add(mgrSplitter, BorderLayout.CENTER);</BUG> }
mgrSplitter.setDividerLocation(0.9); mgrSplitter.setLeftComponent(getCollectionManagementPanel()); mgrSplitter.setRightComponent(createDocumentTreePanel()); add(mgrSplitter, BorderLayout.CENTER);
16,335
selectCollection((Collection) nodeInfo); } mgrSplitter.setDividerLocation(dividerLocation); } }); <BUG>treePanel.add(new JScrollPane(docTree)); return treePanel;</BUG> } private void handleServiceException(Exception ex) { StringWriter sw = new StringWriter();
treePanel.setPreferredSize(new Dimension(200, 500)); return treePanel;
16,336
clnInfoPanel.add(new JLabel("document type:")); clnInfoPanel.add(new JLabel("enabled:")); clnInfoPanel.add(new JLabel("created at:")); clnInfoPanel.add(new JLabel("created by:")); clnInfoPanel.add(new JLabel("")); <BUG>clnInfoPanel.setPreferredSize(new Dimension(500, 90)); clnInfoPanel.setMinimumSize(new Dimension(500, 90)); </BUG> clnInfoPanel.setBorder(BorderFactory.createTitledBorder("collection: "));
clnInfoPanel.setPreferredSize(new Dimension(1000, 90)); clnInfoPanel.setMinimumSize(new Dimension(1000, 90));
16,337
clnStatsPanel.add(new JLabel("fragments:")); clnStatsPanel.add(new JLabel("elements:")); clnStatsPanel.add(new JLabel("full size in bytes:")); clnStatsPanel.add(new JLabel("avg doc size in bytes:")); clnStatsPanel.add(new JLabel("avg doc size in elements:")); <BUG>clnStatsPanel.setPreferredSize(new Dimension(500, 70)); </BUG> clnStatsPanel.setBorder(BorderFactory.createTitledBorder("statistics: ")); panel.add(clnStatsPanel, BorderLayout.NORTH); splitPane.setBottomComponent(panel);
clnStatsPanel.setPreferredSize(new Dimension(1000, 70));
16,338
((JLabel) labels[1]).setText("fragments: " + cln.getFraCount()); ((JLabel) labels[2]).setText("elements: " + cln.getEltCount()); ((JLabel) labels[3]).setText("full size in bytes: " + cln.getByteSize()); ((JLabel) labels[4]).setText("avg doc size in bytes: " + cln.getAvgByteSize()); ((JLabel) labels[5]).setText("avg doc size in elements: " + cln.getAvgEltSize()); <BUG>mgrSplitter.setRightComponent(clnPanel); </BUG> } private JPanel getDocumentManagementPanel() { if (docPanel == null) {
mgrSplitter.setLeftComponent(clnPanel);
16,339
docInfoPanel.add(new JLabel("elements:")); docInfoPanel.add(new JLabel("fragments:")); docInfoPanel.add(new JLabel("collections:")); docInfoPanel.add(new JLabel("partition:")); docInfoPanel.add(new JLabel("owner:")); <BUG>docInfoPanel.setPreferredSize(new Dimension(500, 120)); docInfoPanel.setMinimumSize(new Dimension(500, 120)); </BUG> docInfoPanel.setBorder(BorderFactory.createTitledBorder("document: "));
docInfoPanel.setPreferredSize(new Dimension(1000, 120)); docInfoPanel.setMinimumSize(new Dimension(1000, 120));
16,340
docInfoPanel.setBorder(BorderFactory.createTitledBorder("document: ")); splitPane.setTopComponent(docInfoPanel); contentArea = new JTextArea(); contentArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12)); JScrollPane areaScrollPane = new JScrollPane(contentArea); <BUG>areaScrollPane.setPreferredSize(new Dimension(500, 500)); areaScrollPane.setMinimumSize(new Dimension(500, 500)); </BUG> contentArea.setEditable(false);
areaScrollPane.setPreferredSize(new Dimension(1000, 500)); areaScrollPane.setMinimumSize(new Dimension(1000, 500));
16,341
contentArea.setText(content); contentArea.setCaretPosition(0); } catch (ServiceException ex) { handleServiceException(ex); } <BUG>mgrSplitter.setRightComponent(docPanel); </BUG> } private DefaultMutableTreeNode getCollectionNode(String collection) { Object root = docTree.getModel().getRoot();
mgrSplitter.setLeftComponent(docPanel);
16,342
package org.orekit.estimation.measurements; import org.hipparchus.Field; <BUG>import org.hipparchus.RealFieldElement; import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG> import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.geometry.euclidean.twod.Vector2D;
import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure;
16,343
delay = receiverPosition.distance(transitP).multiply(cReciprocal); delta = FastMath.abs(delay.getReal() - previous); } while (count++ < 10 && delta >= 2 * FastMath.ulp(delay.getReal())); return delay; } <BUG>public OffsetDerivatives getOffsetDerivatives(final int parameters, </BUG> final int eastOffsetIndex, final int northOffsetIndex, final int zenithOffsetIndex)
public OffsetDerivatives getOffsetDerivatives(final DSFactory factory,
16,344
final FieldVector3D<DerivativeStructure> meridianCenterToOffset = zeroNorth.add(offsetOrigin).subtract(meridianCenter); final FieldVector3D<DerivativeStructure> meridianZ = meridianCenterToOffset.normalize(); FieldVector3D<DerivativeStructure> meridianE = FieldVector3D.crossProduct(Vector3D.PLUS_K, meridianZ); if (meridianE.getNormSq().getValue() < Precision.SAFE_MIN) { <BUG>meridianE = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, 1, 0.0), new DerivativeStructure(parameters, 1, 1.0), new DerivativeStructure(parameters, 1, 0.0)); } else {</BUG> meridianE = meridianE.normalize();
meridianE = new FieldVector3D<>(factory.getDerivativeField().getZero(), factory.getDerivativeField().getOne(), factory.getDerivativeField().getZero()); } else {
16,345
final FieldVector3D<DerivativeStructure> transverseCenterToOffset = zeroEast.add(offsetOrigin).subtract(transverseCenter); final FieldVector3D<DerivativeStructure> transverseZ = transverseCenterToOffset.normalize(); FieldVector3D<DerivativeStructure> transverseE = FieldVector3D.crossProduct(Vector3D.PLUS_K, transverseZ); if (transverseE.getNormSq().getValue() < Precision.SAFE_MIN) { <BUG>transverseE = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, 1, 0.0), new DerivativeStructure(parameters, 1, 1.0), new DerivativeStructure(parameters, 1, 0.0)); } else {</BUG> transverseE = transverseE.normalize();
transverseE = new FieldVector3D<>(factory.getDerivativeField().getZero(), factory.getDerivativeField().getOne(), factory.getDerivativeField().getZero()); } else {
16,346
final double[] x = d1.getX().add(d2.getX()).getAllDerivatives(); x[0] = v.getX(); final double[] y = d1.getY().add(d2.getY()).getAllDerivatives(); y[0] = v.getY(); final double[] z = d1.getZ().add(d2.getZ()).getAllDerivatives(); <BUG>z[0] = v.getZ(); final int parameters = d1.getX().getFreeParameters(); final int order = d1.getX().getOrder(); return new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, order, x), new DerivativeStructure(parameters, order, y), new DerivativeStructure(parameters, order, z));</BUG> }
return new FieldVector3D<>(d1.getX().getFactory().build(x), d1.getX().getFactory().build(y), d1.getX().getFactory().build(z));
16,347
package org.orekit.forces; import java.util.ArrayList; import java.util.List; <BUG>import org.hipparchus.RealFieldElement; import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG> import org.hipparchus.geometry.euclidean.threed.FieldRotation; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure;
16,348
private final Vector3D saZ; private double dragCoeff; private double absorptionCoeff; private double specularReflectionCoeff; private double diffuseReflectionCoeff; <BUG>private final PVCoordinatesProvider sun; public BoxAndSolarArraySpacecraft(final double xLength, final double yLength,</BUG> final double zLength, final PVCoordinatesProvider sun, final double solarArrayArea, final Vector3D solarArrayAxis,
private final DSFactory factory; public BoxAndSolarArraySpacecraft(final double xLength, final double yLength,
16,349
final String paramName) throws OrekitException { if (!DRAG_COEFFICIENT.equals(paramName)) { throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, paramName, DRAG_COEFFICIENT); } <BUG>final DerivativeStructure dragCoeffDS = new DerivativeStructure(1, 1, 0, dragCoeff); </BUG> final Vector3D v = rotation.applyTo(relativeVelocity); final Vector3D solarArrayFacet = new Vector3D(solarArrayArea, getNormal(date, frame, position, rotation)); double sv = FastMath.abs(Vector3D.dotProduct(solarArrayFacet, v));
final DerivativeStructure dragCoeffDS = factory.variable(0, dragCoeff);
16,350
import org.orekit.propagation.SpacecraftState; import org.orekit.time.AbsoluteDate; import org.orekit.utils.Constants; import org.orekit.utils.TimeStampedFieldPVCoordinates; public class Range extends AbstractMeasurement<Range> { <BUG>private final GroundStation station; public Range(final GroundStation station, final AbsoluteDate date,</BUG> final double range, final double sigma, final double baseWeight) throws OrekitException { super(date, range, sigma, baseWeight,
private final DSFactory factory; public Range(final GroundStation station, final AbsoluteDate date,
16,351
throws OrekitException { super(date, range, sigma, baseWeight, station.getEastOffsetDriver(), station.getNorthOffsetDriver(), station.getZenithOffsetDriver()); <BUG>this.station = station; }</BUG> public GroundStation getStation() { return station; }
this.factory = new DSFactory(9, 1);
16,352
import org.orekit.frames.Transform; import org.orekit.propagation.SpacecraftState; import org.orekit.time.AbsoluteDate; import org.orekit.utils.AngularCoordinates; public class Angular extends AbstractMeasurement<Angular> { <BUG>private final GroundStation station; public Angular(final GroundStation station, final AbsoluteDate date,</BUG> final double[] angular, final double[] sigma, final double[] baseWeight) throws OrekitException { super(date, angular, sigma, baseWeight,
private final DSFactory factory; public Angular(final GroundStation station, final AbsoluteDate date,
16,353
throws OrekitException { super(date, angular, sigma, baseWeight, station.getEastOffsetDriver(), station.getNorthOffsetDriver(), station.getZenithOffsetDriver()); <BUG>this.station = station; }</BUG> public GroundStation getStation() { return station; }
this.factory = new DSFactory(6, 1);
16,354
final double delta = getDate().durationFrom(state.getDate()); final double dt = delta - tauD; final SpacecraftState transitState = state.shiftedBy(dt); final Frame bodyFrame = station.getOffsetFrame().getParentShape().getBodyFrame(); final Transform iner2Body = state.getFrame().getTransformTo(bodyFrame, getDate()); <BUG>final OffsetDerivatives od = station.getOffsetDerivatives(6, 3, 4, 5); </BUG> final FieldVector3D<DerivativeStructure> east = od.getEast(); final FieldVector3D<DerivativeStructure> north = od.getNorth(); final FieldVector3D<DerivativeStructure> zenith = od.getZenith();
final OffsetDerivatives od = station.getOffsetDerivatives(factory, 3, 4, 5);
16,355
final FieldVector3D<DerivativeStructure> east = od.getEast(); final FieldVector3D<DerivativeStructure> north = od.getNorth(); final FieldVector3D<DerivativeStructure> zenith = od.getZenith(); final FieldVector3D<DerivativeStructure> qP = od.getOrigin(); final Vector3D transitp = iner2Body.transformPosition(transitState.getPVCoordinates().getPosition()); <BUG>final FieldVector3D<DerivativeStructure> pP = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(6, 1, 0, transitp.getX()), new DerivativeStructure(6, 1, 1, transitp.getY()), new DerivativeStructure(6, 1, 2, transitp.getZ())); final FieldVector3D<DerivativeStructure> staSat = pP.subtract(qP);</BUG> final DerivativeStructure baseAzimuth = DerivativeStructure.atan2(staSat.dotProduct(east), staSat.dotProduct(north));
final FieldVector3D<DerivativeStructure> pP = new FieldVector3D<>(factory.variable(0, transitp.getX()), factory.variable(1, transitp.getY()), factory.variable(2, transitp.getZ())); final FieldVector3D<DerivativeStructure> staSat = pP.subtract(qP);
16,356
final double twoPiWrap = MathUtils.normalizeAngle(baseAzimuth.getReal(), getObservedValue()[0]) - baseAzimuth.getReal(); final DerivativeStructure azimuth = baseAzimuth.add(twoPiWrap); final DerivativeStructure elevation = staSat.dotProduct(zenith).divide(staSat.getNorm()).asin(); final EstimatedMeasurement<Angular> estimated = <BUG>new EstimatedMeasurement<Angular>(this, iteration, evaluation, transitState); estimated.setEstimatedValue(azimuth.getValue(), elevation.getValue());</BUG> final AngularCoordinates ac = iner2Body.getInverse().getAngular(); final Vector3D tto = new Vector3D(azimuth.getPartialDerivative(1, 0, 0, 0, 0, 0), azimuth.getPartialDerivative(0, 1, 0, 0, 0, 0),
new EstimatedMeasurement<>(this, iteration, evaluation, transitState); estimated.setEstimatedValue(azimuth.getValue(), elevation.getValue());
16,357
package org.orekit.estimation; import org.hipparchus.analysis.UnivariateFunction; <BUG>import org.hipparchus.analysis.UnivariateVectorFunction; import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG> import org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator; import org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction; import org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction;
import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure;
16,358
import org.orekit.orbits.OrbitType; import org.orekit.orbits.PositionAngle; import org.orekit.propagation.SpacecraftState; import org.orekit.propagation.numerical.NumericalPropagator; import org.orekit.utils.ParameterDriver; <BUG>public class EstimationUtils { private EstimationUtils() {</BUG> } public static ParameterFunction differentiate(final ParameterFunction function, final ParameterDriver driver,
private static final DSFactory FACTORY = new DSFactory(1, 1); private EstimationUtils() {
16,359
if (!parameterDriver.getName().equals(driver.getName())) { throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, parameterDriver.getName(), driver.getName()); } try { <BUG>final DerivativeStructure dsParam = new DerivativeStructure(1, 1, 0, parameterDriver.getNormalizedValue()); </BUG> final DerivativeStructure dsValue = differentiated.value(dsParam); return dsValue.getPartialDerivative(1); } catch (OrekitExceptionWrapper oew) {
final DerivativeStructure dsParam = FACTORY.variable(0, parameterDriver.getNormalizedValue());
16,360
final UnivariateVectorFunction componentJ = new StateComponentFunction(j, function, state, orbitType, positionAngle); final FiniteDifferencesDifferentiator differentiator = new FiniteDifferencesDifferentiator(nbPoints, tolerances[j]); final UnivariateDifferentiableVectorFunction differentiatedJ = <BUG>differentiator.differentiate(componentJ); final DerivativeStructure[] c = differentiatedJ.value(new DerivativeStructure(1, 1, 0, 0.0));</BUG> for (int i = 0; i < dimension; ++i) { jacobian[i][j] = c[i].getPartialDerivative(1);
final DerivativeStructure[] c = differentiatedJ.value(FACTORY.variable(0, 0.0));
16,361
String doi = null; String year = null; try{ dba = (DataByteArray) input.get(0); }catch(Exception e){ <BUG>myreporter.getCounter("extraction problems [DocBasic]","DataByteArray from tuple"); </BUG> return null; } try{
myreporter.getCounter("extraction problems [DocBasic]","DataByteArray from tuple").increment(1);
16,362
return null; } try{ dm = DocumentWrapper.parseFrom(dba.get()).getDocumentMetadata(); }catch(Exception e){ <BUG>myreporter.getCounter("extraction problems [DocBasic]","document metadata"); </BUG> return null; } try{
myreporter.getCounter("extraction problems [DocBasic]","document metadata").increment(1);
16,363
title = title.replaceAll("[^\\w\\-]", " ").replaceAll("\\s++", " ").trim(); } }catch(Exception e){ }finally{ if(title == null || title.trim().isEmpty()){ <BUG>myreporter.getCounter("extraction problems [DocBasic]","title extraction"); </BUG> return null; } }
myreporter.getCounter("extraction problems [DocBasic]","title extraction").increment(1);
16,364
try{ doi = dm.getBasicMetadata().getDoi().replaceAll("\\s++", " ").trim(); }catch(Exception e){ }finally{ if(doi == null || doi.trim().isEmpty()){ <BUG>myreporter.getCounter("extraction problems [DocBasic]","doi extraction"); </BUG> return null; } }
myreporter.getCounter("extraction problems [DocBasic]","doi extraction").increment(1);
16,365
String doi = null; String year = null; try{ dba = (DataByteArray) input.get(0); }catch(Exception e){ <BUG>myreporter.getCounter("extraction problems [DocComplete]","DataByteArray from tuple"); </BUG> return null; } try{
myreporter.getCounter("extraction problems [DocComplete]","DataByteArray from tuple").increment(1);
16,366
return null; } try{ dm = DocumentWrapper.parseFrom(dba.get()).getDocumentMetadata(); }catch(Exception e){ <BUG>myreporter.getCounter("extraction problems [DocComplete]","document metadata"); </BUG> return null; } try{
myreporter.getCounter("extraction problems [DocComplete]","document metadata").increment(1);
16,367
</BUG> R result = seed; for (Map.Entry<E, MutableLong> entry : valueMap.entrySet()) { result = accumulator.apply(result, entry.getKey(), entry.getValue().value()); <BUG>if (predicate.test(entry.getKey(), entry.getValue().value(), result) == false) { </BUG> break; } } return result;
public void forEach(BiConsumer<? super E, Long> action) { action.accept(entry.getKey(), entry.getValue().value()); public <R> R forEach(final R seed, TriFunction<R, ? super E, Long, R> accumulator, final TriPredicate<? super E, Long, ? super R> conditionToBreak) { if (conditionToBreak.test(entry.getKey(), entry.getValue().value(), result)) {
16,368
public MutableDouble setValue(final double value) { this.value = value; return this; } public double getAndSet(final double value) { <BUG>double result = value; </BUG> this.value = value; return result; }
final double result = this.value;
16,369
this.value = value; return result; } public double setAndGet(final double value) { this.value = value; <BUG>return value; </BUG> } public boolean isNaN() { return Double.isNaN(value);
return this; public double getAndSet(final double value) { final double result = this.value; return this.value;
16,370
<R> R forEach(Collection<String> columnNames, int fromRowIndex, int toRowIndex, R seed, BiFunction<R, ? super Object[], R> accumulator, BiPredicate<? super Object[], ? super R> predicate); </BUG> <R> R forEach(Collection<String> columnNames, int fromRowIndex, int toRowIndex, R seed, BiFunction<R, ? super Object[], R> accumulator, <BUG>BiPredicate<? super Object[], ? super R> predicate, boolean shareRowArray); </BUG> Object[][] toArray(); Object[][] toArray(int fromRowIndex, int toRowIndex); <T> T[] toArray(Class<? extends T> rowClass); <T> T[] toArray(Class<? extends T> rowClass, int fromRowIndex, int toRowIndex);
BiPredicate<? super Object[], ? super R> conditionToBreak); BiPredicate<? super Object[], ? super R> conditionToBreak, boolean shareRowArray);
16,371
public MutableChar setValue(final char value) { this.value = value; return this; } public char getAndSet(final char value) { <BUG>char result = value; </BUG> this.value = value; return result; }
final char result = this.value;
16,372
this.value = value; return result; } public char setAndGet(final char value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public char getAndSet(final char value) { final char result = this.value; return this.value;
16,373
</BUG> R result = seed; for (Map.Entry<E, MutableInt> entry : valueMap.entrySet()) { result = accumulator.apply(result, entry.getKey(), entry.getValue().value()); <BUG>if (predicate.test(entry.getKey(), entry.getValue().value(), result) == false) { </BUG> break; } } return result;
public void forEach(BiConsumer<? super E, Integer> action) { action.accept(entry.getKey(), entry.getValue().value()); public <R> R forEach(final R seed, TriFunction<R, ? super E, Integer, R> accumulator, final TriPredicate<? super E, Integer, ? super R> conditionToBreak) { if (conditionToBreak.test(entry.getKey(), entry.getValue().value(), result)) {
16,374
public MutableBoolean setValue(final boolean value) { this.value = value; return this; } public boolean getAndSet(final boolean value) { <BUG>boolean result = value; </BUG> this.value = value; return result; }
final boolean result = this.value;
16,375
this.value = value; return result; } public boolean setAndGet(final boolean value) { this.value = value; <BUG>return value; </BUG> } public void setFalse() { this.value = false;
return this; public boolean getAndSet(final boolean value) { final boolean result = this.value; return this.value;
16,376
public MutableFloat setValue(final float value) { this.value = value; return this; } public float getAndSet(final float value) { <BUG>float result = value; </BUG> this.value = value; return result; }
final float result = this.value;
16,377
this.value = value; return result; } public float setAndGet(final float value) { this.value = value; <BUG>return value; </BUG> } public boolean isNaN() { return Float.isNaN(value);
return this; public float getAndSet(final float value) { final float result = this.value; return this.value;
16,378
public MutableByte setValue(final byte value) { this.value = value; return this; } public byte getAndSet(final byte value) { <BUG>byte result = value; </BUG> this.value = value; return result; }
final byte result = this.value;
16,379
this.value = value; return result; } public byte setAndGet(final byte value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public byte getAndSet(final byte value) { final byte result = this.value; return this.value;
16,380
public MutableLong setValue(final long value) { this.value = value; return this; } public long getAndSet(final long value) { <BUG>long result = value; </BUG> this.value = value; return result; }
final long result = this.value;
16,381
this.value = value; return result; } public long setAndGet(final long value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public long getAndSet(final long value) { final long result = this.value; return this.value;
16,382
public MutableInt setValue(final int value) { this.value = value; return this; } public int getAndSet(final int value) { <BUG>int result = value; </BUG> this.value = value; return result; }
final int result = this.value;
16,383
this.value = value; return result; } public int setAndGet(final int value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public int getAndSet(final int value) { final int result = this.value; return this.value;
16,384
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
16,385
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
16,386
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
16,387
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
16,388
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
16,389
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
16,390
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
16,391
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
16,392
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
16,393
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
16,394
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
16,395
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
16,396
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
16,397
import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Lazy; import com.giffing.wicket.spring.boot.context.extensions.WicketApplicationInitConfiguration; <BUG>import com.giffing.wicket.spring.boot.context.scan.WicketHomePage; import com.giffing.wicket.spring.boot.starter.app.classscanner.candidates.WicketClassCandidatesHolder;</BUG> import com.giffing.wicket.spring.boot.starter.configuration.extensions.core.settings.general.GeneralSettingsProperties; @Lazy public class WicketBootStandardWebApplication extends WebApplication implements WicketBootWebApplication {
import com.giffing.wicket.spring.boot.starter.app.classscanner.candidates.WicketClassCandidate; import com.giffing.wicket.spring.boot.starter.app.classscanner.candidates.WicketClassCandidatesHolder;
16,398
if(internalErrorPageCandidates.size() > 0) { if(internalErrorPageCandidates.size() == 1){ WicketClassCandidate<Page> internalErrorPage = internalErrorPageCandidates.get(0); applicationSettings.setInternalErrorPage(internalErrorPage.getCandidate()); } else { <BUG>throw new IllegalStateException("Multiple annotation of " + WicketInternalErrorPage.class.getName() + " found"); }</BUG> } } private void configureAccessDeniedPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> accessDeniedPageCandidates) {
throwExceptionOnMultipleAnnotations(WicketInternalErrorPage.class, internalErrorPageCandidates);
16,399
if(accessDeniedPageCandidates.size() > 0) { if(accessDeniedPageCandidates.size() == 1){ WicketClassCandidate<Page> accessDeniedPage = accessDeniedPageCandidates.get(0); applicationSettings.setAccessDeniedPage(accessDeniedPage.getCandidate()); } else { <BUG>throw new IllegalStateException("Multiple annotation of " + WicketAccessDeniedPage.class.getName() + " found"); }</BUG> } } private void configureExpiredPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> expiredPageCandidates) {
throwExceptionOnMultipleAnnotations(WicketAccessDeniedPage.class, accessDeniedPageCandidates);
16,400
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import com.giffing.wicket.spring.boot.context.extensions.WicketApplicationInitConfiguration; import com.giffing.wicket.spring.boot.context.scan.WicketHomePage; import com.giffing.wicket.spring.boot.context.scan.WicketSignInPage; <BUG>import com.giffing.wicket.spring.boot.context.security.AuthenticatedWebSessionConfig; import com.giffing.wicket.spring.boot.starter.app.classscanner.candidates.WicketClassCandidatesHolder;</BUG> import com.giffing.wicket.spring.boot.starter.configuration.extensions.core.settings.general.GeneralSettingsProperties; public class WicketBootSecuredWebApplication extends AuthenticatedWebApplication implements WicketBootWebApplication { private final static Logger logger = LoggerFactory
import com.giffing.wicket.spring.boot.starter.app.classscanner.candidates.WicketClassCandidate; import com.giffing.wicket.spring.boot.starter.app.classscanner.candidates.WicketClassCandidatesHolder;