Project

General

Profile

9447a.patch

Stefan Vieru, 02/20/2025 08:03 AM

Download (4.11 KB)

View differences:

new/src/com/goldencode/p2j/xml/SaxReaderImpl.java 2025-02-20 12:55:20 +0000
147 147

  
148 148
   /** Flag indicating if the parser had a prolog error. */
149 149
   private boolean prologError = false;
150

  
151
   /**
152
    * Entity expansion limit variable
153
    */
154
   private integer entityExpansionLimit = new integer(50000);
150 155
   
151 156
   /**
152 157
    * Default constructor.
......
457 462
   @Override
458 463
   public integer getEntityExpansionLimit()
459 464
   {
460
      // TODO
461
      return new integer();
465
      return new integer(entityExpansionLimit);
462 466
   }
463 467

  
464 468
   /**
......
470 474
   @Override
471 475
   public void setEntityExpansionLimit(int64 limit)
472 476
   {
473
      // TODO
474
   }   
477
      setEntityExpansionLimit(new integer(limit));
478
   }
475 479

  
476 480
   /**
477 481
    * Set the entity expansion limit.
......
482 486
   @Override
483 487
   public void setEntityExpansionLimit(long limit)
484 488
   {
485
      setEntityExpansionLimit(new int64(limit));
486
   }
489
      setEntityExpansionLimit(new integer(limit));
490
   }
491

  
492
   @Override
493
   public void setEntityExpansionLimit(integer limit)
494
   {
495
      if (!limit.isUnknown() && limit.intValue() < 0)
496
      {
497
         String msg = String.format("Attribute ENTITY-EXPANSION-LIMIT must be greater than or equal to" +
498
                                    " 0 on %s widget", type());
499
         ErrorManager.recordOrShowError(4082, msg, false, true, false);
500
         return;
501
      }
502

  
503
      this.entityExpansionLimit = limit;
504
   }
505

  
506

  
487 507
   
488 508
   /**
489 509
    * Indicates if the parser validates the XML document against DTD or not.
new/src/com/goldencode/p2j/xml/XDocumentImpl.java 2025-02-20 12:55:20 +0000
150 150
   /** The value of the NONAMESPACE-SCHEMA-LOCATION attribute. */
151 151
   private String noNamespaceSchemaLocation = null;
152 152

  
153
   /**
154
    * Entity expansion limit variable
155
    */
156
   private integer entityExpansionLimit = new integer(50000);
157

  
153 158
   /** The added schema locations, per namespace URI. */
154 159
   private Map<String, String> schemaLocations = new HashMap<>();
155 160
   
......
1747 1752
   @Override
1748 1753
   public integer getEntityExpansionLimit()
1749 1754
   {
1750
      // TODO
1751
      return new integer();
1755
      return new integer(entityExpansionLimit);
1752 1756
   }
1753 1757

  
1754 1758
   /**
......
1760 1764
   @Override
1761 1765
   public void setEntityExpansionLimit(int64 limit)
1762 1766
   {
1763
      // TODO
1764
   }   
1767
      setEntityExpansionLimit(new integer(limit));
1768
   }
1769

  
1770
   /**
1771
    * Set the entity expansion limit.
1772
    *
1773
    * @param    limit
1774
    *           The new value for the attribute.
1775
    */
1776
   @Override
1777
   public void setEntityExpansionLimit(integer limit)
1778
   {
1779
      if (!limit.isUnknown() && limit.intValue() < 0)
1780
      {
1781
         String msg = String.format("Attribute ENTITY-EXPANSION-LIMIT must be greater than or equal to" +
1782
                                    " 0 on %s widget", type());
1783
         ErrorManager.recordOrShowError(4082, msg, false, true, false);
1784
         return;
1785
      }
1786

  
1787
      this.entityExpansionLimit = limit;
1788
   }
1765 1789

  
1766 1790
   /**
1767 1791
    * Set the entity expansion limit.
......
1772 1796
   @Override
1773 1797
   public void setEntityExpansionLimit(long limit)
1774 1798
   {
1775
      setEntityExpansionLimit(new int64(limit));
1799
      setEntityExpansionLimit(new integer(limit));
1776 1800
   }
1777 1801

  
1778 1802
   /**
new/src/com/goldencode/p2j/xml/XmlSchema.java 2025-02-20 09:51:08 +0000
194 194
    */
195 195
   @LegacyAttribute(name = "ENTITY-EXPANSION-LIMIT", setter = true)
196 196
   public void setEntityExpansionLimit(long limit);
197

  
198
   /**
199
    * Set the entity expansion limit.
200
    *
201
    * @param    limit
202
    *           The new value for the attribute.
203
    */
204
   @LegacyAttribute(name = "ENTITY-EXPANSION-LIMIT", setter = true)
205
   public void setEntityExpansionLimit(integer limit);
197 206
}